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: '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
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.
 17-Sep-2008 17:28
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

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
Report this to a Moderator Report this to a Moderator
 17-Sep-2008 19:42
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 17-Sep-2008 22:05
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

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
Report this to a Moderator Report this to a Moderator
 18-Sep-2008 08:36
User is offline View Users Profile Print this message


Anders Vestlin

Posts: 11
Joined: 30-Aug-2007

I have no problems with this in 8.1:

infoBox("hello")
sleep_(5000)
infoBox("By!")

It delays as expected.
Report this to a Moderator Report this to a Moderator
 18-Sep-2008 15:15
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 18-Sep-2008 18:07
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.