Timer

rcgomez11

Member
Hi, Gud morning there ProgressTalkers, please i know you can help me with my problem, i wanted to build a simple module that handles timer, yeah, that every for example 10 sec it displays a message, i haven't tried to deal with timers before thats why im seeking for help form you guys, thanks in advance...
 
If it's GUI you'll want to check out the pstimer ocx. If not, then you'll want to read up on ETIME().
 
Progress Version 9.1e
There will be a simple form, maybe it is what you said a GUI. By the way Stefan, can you also tell me what is ChUI?hope you can send me some bit of codes for my reference, thank you for your reply and Mr. Cringer.
 
CHUI is a Character User Interface. GUI is Graphical User Interface. GUI applications you build using the AppBuilder to make windows and dialogs that display in a Windows environment. For CHUI, it's just text sreens basically.

Here's one I wrote earlier - it takes a delay time in milliseconds:

Code:
FUNCTION Delay RETURNS LOGICAL
  ( ipDelayTime AS INTEGER ) :
/*------------------------------------------------------------------------------
  Purpose:  
    Notes:  
------------------------------------------------------------------------------*/
  ETIME(TRUE).
  DO WHILE ETIME LE ipDelayTime:
  END.

  RETURN TRUE.   /* Function return value. */

END FUNCTION.

So you can do something like:

Code:
ttPossibleMoves.WidgetHandle:HIDDEN = delay(200).
 
thank you so much Mr. cringer, sorry but i'll take my chance today to query one more time, how bout getting the last day every month, like in a selection box, if i choose to january it will message me 31 for january consists of 31 days and february 28 or 29 if leap year, thank you so much and thanks again...
 
You need to find the date of the first day of the next month and then subtract 1.
 
CHUI is a Character User Interface. GUI is Graphical User Interface. GUI applications you build using the AppBuilder to make windows and dialogs that display in a Windows environment. For CHUI, it's just text sreens basically.

Here's one I wrote earlier - it takes a delay time in milliseconds:

Code:
FUNCTION Delay RETURNS LOGICAL
  ( ipDelayTime AS INTEGER ) :
/*------------------------------------------------------------------------------
  Purpose:  
    Notes:  
------------------------------------------------------------------------------*/
  ETIME(TRUE).
  DO WHILE ETIME LE ipDelayTime:
  END.

  RETURN TRUE.   /* Function return value. */

END FUNCTION.

So you can do something like:

Code:
ttPossibleMoves.WidgetHandle:HIDDEN = delay(200).

I strongly recommend never using ETIME( TRUE ), it will destroy any chance you have of using the profiler and will probably throw a spanner in the works of any other source that also needs to use ETIME.

You also generally do not want loops like this doing nothing, as they will race and take all the CPU they can. Add a PAUSE 1 NO-MESSAGE in between to tell progress to take it easy. Unfortunately the smallest pause is 1 second, so if you need something more fine grained then look at the pstimer.ocx.

Code:
FUNCTION Delay RETURNS LOGICAL
  ( ipDelayTime AS INTEGER ) :
/*------------------------------------------------------------------------------
  Purpose:  
    Notes:  
------------------------------------------------------------------------------*/
  DEF VAR ietime AS INT NO-UNDO.
  
  ietime = ETIME(FALSE) + ipDelayTime.
  DO WHILE ETIME LE ietime:
    PAUSE 1 NO-MESSAGE.
  END.

  RETURN TRUE.   /* Function return value. */

END FUNCTION.
 
Back
Top