IdleProgram

Prev Next Home Home Table Of Contents Index

IdleProgram : Procedure

IdleProgram is a variable that when set to the location of a procedure allows the procedure to run while waiting at the keyboard. This is done by writing a procedure that will run while waiting for input.

The way you use this is to set an internal variable named IdleProgram to the Loc of the procedure you want to run as follows:


Example:
IdleProgram = Loc MyProcedure

Note: Do not use parentheses around MyProcedure.

When writing MyProcedure make it as short and quick as possible. As of now, MyProcedure is called continuously while there is no keyboard input. You can also use a loop in it as follows.


 Procedure MyProcedure
    SetItUp
    while not KBDReady
       {do your thing}
    endwhile
    PutItBack
 EndProc

MarxMenu doesn't automatically exit your procedure or save and restore anything. If you're writing to the screen you have to put everything back the way it was.

If you want to run a program at a specific time, here's how it can be done:


 Procedure MyProcedure
    if Now = TimeOf('11:00pm')
       Bat 'NIGHT'             ;run NIGHT.BAT
       ExitMenu
    endif
    if Now = TimeOf('5:00')
       Bat 'MORNING'           ;run MORNING.BAT
       ExitMenu
    endif
 EndProc

To disable IdleProgram run:


  Dispose(IdleProgram)

See Also: Run Loc BlankScreenProgram

Category: Execution

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home