Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2009
    Posts
    33

    Repeat Loop problem...hanging

    Hi. I'm trying to pull the URl from a web object and while it is "Site_1" continue to watch it. If that changes, the proceed to the if statement. Problem is, it seems to hang on the "Repeat" loop. In Vista i get a "Not Responding and the app just hangs, even the web object doesn't auto refresh as written in the code. Would someone mind checking the code to see if I'm missing something stupid? Thanks!

    Code:
    Web.LoadURL("Web1", "http://SITE_1.html");
    Dialog.TimedMessage("Please Wait...", "Loading Content...", 3000, MB_ICONINFORMATION); -- gives web obj time to load
    
    current_URL = Web.GetURL("Web1");
    
    repeat
    current_URL = Web.GetURL("Web1");
    until current_URL ~= "http://SITE_1.html";
    
    if current_URL == "http://SITE_2.html" then
    	adios = Dialog.Message("Notice", "We're sorry.  It's too late to join this week's feed. The program will now close.  Please check back next week.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); 
    	Application.Exit();
    else
    --basic timer stuff here
    end

  2. #2
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    Your loop will go on repeating until the URL changes and since no other code can be executed, the URL will never change.

    Try moving your loop code onto a timer instead.
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  3. #3
    Join Date
    Jun 2009
    Posts
    33
    I have the url set to auto refresh and redirect a a certain time. i've been changing that time for testing and it has been redirecting when it is supposed to. So it refreshes every 10 seconds and redirects either to site A or B based on the time on the server.

    Problem seems to be the loop hangs and the web page/object refreshing stops. A timer really won't work because everyone will have to wait different times depending on when they enter into the page.

    This is the VERY LAST problem I have in making this work....I really need it knocked out tonight.

  4. #4
    Join Date
    Mar 2009
    Location
    -31.9554,115.85859
    Posts
    282
    Just out of curiosity have you tried the IExplorer plugin that was made by Reteset? It is way better than the web object you appear to be using, it may have another feature you may find that does the job you need it to do.

    http://www.indigorose.com/forums/showthread.php?t=25090

  5. #5
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    I think you should use the On Loaded event to trigger your URL verification...

    Ulrich

  6. #6
    Join Date
    Jun 2009
    Posts
    33
    Fantastic Suggestion! After about 20 minutes of fiddling with it, It works! Thank you!

  7. #7
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    For future reference, you are not limited to one timer if you use the AMSWaves Timer plugin. You can have as many timers as you like.
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  8. #8
    Join Date
    Jun 2009
    Posts
    33
    That, too, is a great suggestion!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts