Loop in script to wait for variable change

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • blazm
    Indigo Rose Customer
    • Dec 2002
    • 27

    Loop in script to wait for variable change

    Hi,

    I have gone through threads and did find some similar questions but without an acceptable answer...

    Is it posible to pause a script which is currently being executed and wait for some change, then continue with the script execution? An example would be:

    Page:On Show
    -- Loop (repear until, while do...)
    repeat
    until clicked
    Label.SetText("Label1","Clicked1");
    ...


    Button:On Clicked
    clicked=true;

    Best regards,

    Blaz
  • holtgrewe
    Indigo Rose Customer
    • Jul 2002
    • 779

    #2
    Start your Page timer On Show, then Place your 'clicked' test On Timer

    That should get you on the right track.

    hth

    Comment

    • blazm
      Indigo Rose Customer
      • Dec 2002
      • 27

      #3
      Why? I require something to happen when I press the button, not when the timer is triggered.

      Best regards,

      Blaz

      Comment

      • holtgrewe
        Indigo Rose Customer
        • Jul 2002
        • 779

        #4
        Sorry, I'm confused.

        If you want something to happen when the button is pressed then just place your scripting on the Button On Click action.

        hth

        Comment

        • blazm
          Indigo Rose Customer
          • Dec 2002
          • 27

          #5
          The thing is like this:
          - the script on page detectes several properties of OS and if something is wrong, the user is prompted to select the action by pressing a desired button; example:

          page script detects that OS is not supported, user is given the choice to exit or force continue (two buttons appear). Based on the button it was pressed (the button script performs some action), the page script continues with the next detection.

          I have a workaround for this but is cumbersome. I have to exit page script, wait for the button to be pressed, jump back to the page and check what was allready done, then continue...

          Best regards,


          Blaz

          Comment

          • holtgrewe
            Indigo Rose Customer
            • Jul 2002
            • 779

            #6
            Sorry, I'm probably in over my head on this one.
            Based on my understanding, you should be able to hang it into a tight loop waiting for either button to be depressed, as you've indicated.

            Optionally, break the script into smaller functions testing the success of each step prior to proceeding...

            Sorry I can't be of more help.

            I'm certain others in the forum can assist.

            Comment

            • Lorne
              Indigo Rose Staff Member
              • Feb 2001
              • 2729

              #7
              holtgrewe is correct. Instead of trying to pause the script to wait for the buttons, break it into smaller functions that can be called when the buttons are clicked.
              --[[ Indigo Rose Software Developer ]]

              Comment

              Working...
              X