| 4D v15.4Test semaphore | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | 
    4D v15.4
 Test semaphore 
         | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Test semaphore ( semaphore ) -> Function result | ||||||||
| Parameter | Type | Description | ||||||
| semaphore | String |   | Name of the semaphore to test | |||||
| Function result | Boolean |   | True = the semaphore exists, False = the semaphore doesn’t exist | |||||
The Test semaphore command tests for 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 exist. If the semaphore exists, the function returns True. Otherwise, it returns False.
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
	Product:  4D
	Theme:  Process (Communications)
	Number:  
        652
        
        
        
	
	Created:  4D v6.5
	
	
	
	
	4D Language Reference ( 4D v15.4)
	
	
	
	4D Language Reference ( 4D v15)
	
	
	
	
	4D Language Reference ( 4D v15.3)
 Add a comment
Add a comment