Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: bool copyToClipboard(s) or void copyToClipboard(s) ?
Topic Summary: What type returned by copyToClipboard(string s) ?
Created On: 27-Sep-2006 10:36
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 27-Sep-2006 10:36
User is offline View Users Profile Print this message


Martin Erdelen

Posts: 15
Joined: 14-Aug-2006

Hello,

DOORS 8.1 has a new function copyToClipboard, which according to the Help text returns a Boolean value:
         Declaration
         bool copyToClipboard(string s)        

However, this code:

bool ok
string s = "12345"
ok = copyToClipboard(s)
print ok"\n"

halts with runtime error "Line 4: unassigned variable (ok)".
(and with an initial bool ok = false you end up with false even though the copy action did work.)

So, should it actually be
 
       void copyToClipboard(string s)

or am I overlooking something else?

Cheers,
Martin
Report this to a Moderator Report this to a Moderator
 27-Sep-2006 12:46
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

The manual is correct, the function is supposed to retuen a boolean, otherwise you would be getting syntax errors.

I guess this must be a bug.

Curiously, look at the following code, executing a return statement without a parameter returns true.

bool ok = false

bool doIt()
{
return
}

ok = doIt

print ok "\n"

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 27-Sep-2006 13:04
User is offline View Users Profile Print this message


Martin Erdelen

Posts: 15
Joined: 14-Aug-2006

..perhaps it has to do with the old  (programming-) linguistic/cultural mix-up between Booleans and Return Codes?

       boolean 0 equivalent to FALSE
       boolean 1 equivalent to TRUE

but

       return code rc = 0   equivalent to "all is well" ("TRUE, it worked")
       return code rc >= 1   equivalent to "something is FALSE"



Thanks for the reply!
Martin

Report this to a Moderator Report this to a Moderator
 27-Sep-2006 18:35
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

Martin,

You are declaring a boolean variable called "ok", but that is also a built in function:

DBE ok(DB box,[string label,] void callback(DB)).

Could that be part of the problem?

-------------------------
Michael Sutherland
michael@galactic-solutions.com
http://galactic-solutions.com
Report this to a Moderator Report this to a Moderator
 28-Sep-2006 06:52
User is offline View Users Profile Print this message


Martin Erdelen

Posts: 15
Joined: 14-Aug-2006

Hello,

apparently not: renaming the variable did not help.

Still, it's good to know about this; thanks for the hint.

Cheers,
Martin
Report this to a Moderator Report this to a Moderator
 28-Sep-2006 09:36
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Martin, have you reported this to Telelogic as a bug?

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.