Navigation:  Reference > Functions >

Wait_Check()

Print this Topic Previous pageReturn to chapter overviewNext page

 

The Wait_Check() function will return a value of  0 if there are not any external processes in operation.

 

Use this function to check to see if you have used the EXEC command with the wait option.  for detailed examples see EXEC command.

 

Note: if you use the wait option in the EXEC command and do not protect your screen events with a Wait_Check().  If the program exits you will get a AV and you may lockup the computer you working with because you told the computer to wait. So when you leave the program the computer will try to continue processing the next line of code and since you exited the program there will be no pointer in memory to return to.

 

EXAMPLE

// EXAMPLE for wait and Wait_Check()

// If the user was to click the exit button before you were done and you do not protect your programming

// like this you will get an error because the program would be gone.

 

BUTTON1.CLICK:

  EXEC 'WORDPAD' with 'TEST.SRC' WAIT

 

BUTTON.CLICK:

    if Wait_Check() > 0

       msg 'you have not finished your editing yet you can not exit from this program.'

     ret .f.

   endif

    quit

  ret .t.

// END EXAMPLE

 

//Here is how you can get it to wait

testexec.Click:
 exec '.\sample\testbatch.bat' wait
loopit:

if wait_check() <> 0
     goto loopit // Program will loop until batch file is done.
 endif
 msg 'done'
 Ret

 

 


Page url: http://www.cassoftware.com/tas/manual/check_wait().htm