![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
..perhaps it has to do with the old (programming-) linguistic/cultural mix-up between Booleans and Return Codes? boolean 0 equivalent to FALSE return code rc = 0 equivalent to "all is well" ("TRUE, it worked") |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
Hello,
apparently not: renaming the variable did not help. Still, it's good to know about this; thanks for the hint. Cheers, Martin |
|
![]() |
|
![]() |
|
Martin, have you reported this to Telelogic as a bug?
------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.