4D v14.3

IDLE

Home

 
4D v14.3
IDLE

IDLE 


 

IDLE  
Does not require any parameters

The IDLE command is designed only for use with the compiler. This command is only used in compiled databases in which user-defined methods are written so that no calls are made back to the 4D engine. For example, if a method has a For loop in which no 4D commands are executed, the loop could not be interrupted by a process installed with ON EVENT CALL, nor could a user switch to another application. In this case, you should insert IDLE to allow 4D to trap events. If you do not want any interruptions, omit IDLE.

Example  

In the following example, the loop would never terminate in a compiled database without the call to IDLE:

  ` Do Something Project Method
 ON EVENT CALL("EVENT METHOD")
 ◊vbWeStop:=False
 MESSAGE("Processing..."+Char(13)+"Type any key to interrupt...")
 Repeat
  ` Do some processing that doesn’t involve a 4D command
    IDLE
 Until(◊vbWeStop)
 ON EVENT CALL("")

with:

  ` EVENT METHOD Project Method
 If(Undefined(KeyCode))
    KeyCode:=0
 End if
 If(KeyCode#0)
    CONFIRM("Do you really want to stop this operation?")
    If(OK=1)
       ◊vbWeStop:=True
    End if
 End if

 
PROPERTIES 

Product: 4D
Theme: Compiler
Number: 311

 
HISTORY 

Created: < 4D v6

 
SEE ALSO 

Compiler Commands
ON EVENT CALL

 
ARTICLE USAGE

4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)