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: Waiting for a function succeed
Topic Summary:
Created On: 4-Dec-2008 10:52
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.
 4-Dec-2008 10:52
User is offline View Users Profile Print this message


David BATAILLE

Posts: 3
Joined: 23-Jun-2008

Hi DLX users,

Is there a way for waiting a function succeed ?

For example, I would like to wait (during 1 minute max for example) for locking an object that is already locked by an other user

I wanted to try a "while true" statement with a timer until the lock function succeed but I don't know if it's the good way

Does anyone had this case to solve ?

Thanks and regards
Report this to a Moderator Report this to a Moderator
 4-Dec-2008 13:13
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Get the start time and store it.
Do a while loop that tests for while the current time is less than or equal to one minute from the start time.
Inside that, try to lock the object, breaking from the loop if it is successful.
Have a bool that store whether the operation was successful as well.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 4-Dec-2008 13:23
User is offline View Users Profile Print this message


David BATAILLE

Posts: 3
Joined: 23-Jun-2008

Thanks David

It is exactly what I was trying

pragma runLim,0

int iStart = intOf(today)
bool bSucceed = false

while (true && (intOf(today)-iStart < 60))
{
if (isShare current)
{
string mess = lock current Object
if (!null mess)
print "lock failed"
else
{
bSucceed = true
break
}
}
}

ack "End"

I was just a little affraid that the infinite loop statement freeze every thing into DOORS but it works well

Thanks a lot

David BATAILLE
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.