Test semaphore

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 6.5


Test semaphore (semaphore) Boolean

ParameterTypeDescription
semaphoreStringName of the semaphore to test
Function resultBooleanTrue = the semaphore exists,
False = the semaphore doesn't exist

Description

The Test semaphore command allows you to test the existence of a semaphore.

The difference between the Semaphore function and the Test semaphore function is that Test semaphore doesn't create the semaphore if it doesn't exit. If the semaphore exists, the function returns True. Otherwise, it returns False.

Example

The following example allows you to know the state of a process (in our case, while modifying the code) without modifying semaphore:

   $Win:=Open window (x1;x2;y1;y2;-Palette window)
   Repeat
      If (Test semaphore("Encrypting code"))
         POSITION MESSAGE ($x3;$y3)
         MESSAGE("Encrypting code being modified.")
      Else 
         POSITION MESSAGE($x3;$y3)
         MESSAGE("Modification of the encrypting code authorized.")
      End if 
   Until (StopInfo)
   CLOSE WINDOW

See Also

Semaphore.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next