Question How to make a Time-Loop with Slider

Ragman

New Member
Hello,

we are using Progress 10.2B in our Company.
I try to make a programm wich checks in an user-defined interval (over a slider in App-Builder)
the locks and some other behavior of our database.

For this i have a Slider with a "ON VALUE-CHANGED" Trigger.

Code:
    ON VALUE-CHANGED OF SLIDER-1 IN FRAME DEFAULT-FRAME
    DO:
        PAUSE 0.5 NO-MESSAGE. /* Need this, otherwise i can not adjust the slider, so i have 0,5 sec time to do*/
        /*Make Millisec from the screen-value of the slider*/
        ASSIGN iMsec = INTEGER( SLIDER-1:SCREEN-VALUE ) / 10000. /*Range ist from 50 to 2000*/

       MESSAGE iMsec  SKIP
       VIEW-AS ALERT-BOX.
  
       RUN pGetStatusShopfloor.
END.

After that i jump to the Procedure:
/*Procedure is in the Moment only to see if the Pause works fine ...*/
PROCEDURE pGetStatusShopfloor:
     schleife:  
     DO WHILE TRUE:
         PAUSE iMsec NO-MESSAGE.
          /*Do this that the procedure ends after 10 cycles*/
          iHelp = iHelp + 1.
          IF iHelp = 10 THEN
          DO:
              /*I can adjust in Slider what ever i want, biggest time should be 2 seconds but the
                   Pause is allways very fast and there is no adjustment possible :-( */
              MESSAGE iHelp  
              VIEW-AS ALERT-BOX.
  
              ASSIGN iHelp = 0.
              LEAVE schleife.
  
          END.
    END.
END PROCEDURE.

I hope i could explane my problem well, if not feel free to ask me, if you want.
I whish you a nice evening and hope for some nice statements,

best regards
Ragman

Edit: Added code tags
 
Last edited by a moderator:

oli

Member
Hi Ragman,

I'm not sure of what you want to do, but if you want to run "pGetStatusShopfloor" in a regular basis (with an interval defined by the user), why don't you use the PSTimer control?
For instance:

Code:
ON VALUE-CHANGED OF SLIDER-1 IN FRAME DEFAULT-FRAME
DO:
   chCtrlFrame:PSTimer:Interval = INT(SELF:SCREEN-VALUE) * 1000.
END.

PROCEDURE CtrlFrame.PSTimer.Tick .
   RUN pGetStatusShopfloor.
END PROCEDURE.
 
Top