![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: 'wait' function Topic Summary: How does the void sleep_(int milliseconds) work in actual practice? Created On: 17-Sep-2008 17:28 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I am testing the wait function in the following script:
int i = 9 int j = 7 print (i+j) "\n" sleep_(5000) print "ALL DONE" I expected a time delay of 5 sec between the printing of 16 and ALL DONE. It does not happen. If we want to suspend the operation for a specified period of time before executing the next line of code, how can we use the 'sleep_" function? We are using DOORS 8.3 version. - Krishna |
|
![]() |
|
![]() |
|
I think the print statements are buffered, and only displayed when you fill up some buffer or program ends. Thus you are in fact printing and waiting 5 seconds, but the 1st print statement isn't displayed until the program ends.
Change the prints to 'ack' and I think you'll see your 5 second delay. - Louie |
|
![]() |
|
![]() |
|
In the original post, the function used is void sleep_5000, not void sleep_(5000). The later gives a syntax error.
There is no difference in the time interval for the 'print' or 'ack' statements. It appears that the dxl is recognizing void sleep_5000 as a variable and not as a function. Since the void sleep_ is an undocumented function, probably it is ineffective in version 8 of DOORS. Is there any other function we can make use of? - Krishna |
|
![]() |
|
![]() |
|
I have no problems with this in 8.1:
infoBox("hello") sleep_(5000) infoBox("By!") It delays as expected. |
|
![]() |
|
![]() |
|
Anders code works for me in v8.1 and also in v8.3.
Don't understand your references to 'the original post', but "sleep_5000" is indeed a variable name and you should get DXL errors if you use it. Perhaps you intended a space: "sleep_ 5000". - Louie |
|
![]() |
|
![]() |
|
Hi Anders and Louie,
Thanks for the posts. Initially I tried the 'sleep_' function with the 'print'. As Louie pointed, the results are getting buffered and there was no time delay. Then I tried void sleep_ with 'ack'. Well, that gave an error. Thanks again for indicating the right format to use the function. It works in my version as well now. - Krishna |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
'wait' function
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.