SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Oct 2002
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Synchronization - wait for a maximum of 100 secs

    In the test script can you wait for a maximum of "x" secs for a label to appear without using any of the synchronization functions like obj_wait_info, etc. ???

  2. #2
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Synchronization - wait for a maximum of 100 secs

    This will wait up to 100 tries, each try being 1 second plus situation-dependent processing time:

    maxTries = 100;
    counter = 0;
    while(obj_exists(myObject) != E_OK)
    {
    counter++;
    if(counter >= maxTries)
    {
    # report/handle error here?
    break;
    }
    wait(1);
    }

    If precise timing is important, then you could do something like:

    maxTimeSecs = 100;
    timeNow = get_time();
    while(obj_exists(myObject) != E_OK)
    {
    if(get_time() >= timeNow + maxTimeSecs)
    {
    # report/handle error here?
    break;
    }
    wait(1);
    }


    ------------------
    Charles Reace
    charlesDOTreaceATverizonDOTnet

    "Any sufficiently advanced bug is indistinguishable from a feature." -Bruce Brown

    [This message has been edited by Charles Reace (edited 03-03-2003).]
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

  3. #3
    Junior Member
    Join Date
    Oct 2002
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Synchronization - wait for a maximum of 100 secs

    Thanks a lot.

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:06 AM.

Copyright BetaSoft Inc.