![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Waiting for a function succeed Topic Summary: Created On: 4-Dec-2008 10:52 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Waiting for a function succeed
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.