Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_isslock( [ <csemaphore>|<asemaphores> ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_ISSLOCK( [ <cSemaphore>|<aSemaphores> ] )


Parameters

<cSemaphore>
Name of a semaphore.

<aSemaphores>
Array to receive the current station's semaphores. Must have at least 
ten elements.


Returns

N_ISSLOCK() returns the number of active semaphores.

N_ISSLOCK(<cSemaphore>) returns logical true if the specified semaphore 
is locked at the current station.


Description

N_ISSLOCK(<cSemaphore>) ignores case (upper or lower), but leading or 
trailing spaces are significant.

N_ISSLOCK(<aSemaphores>) stores all of the current station's semaphores 
in the target array. The array should be ten elements long, which is 
the maximum number of semaphores that a station can have outstanding.


Examples

DO WHILE N_SLOCK('ABC')
ENDDO
DO WHILE N_SLOCK('DEF')
ENDDO

? N_ISSLOCK('DEF')
.T.

? N_ISSLOCK('XYZ')
.F.

DECLARE aSema[10]
N_ISSLOCK(aSema)
? aSema[1]
ABC

? aSema[2]
DEF

? aSema[3]
<null string>

// Test condition to only allow five
// users to run this application
PROCEDURE OkToContinue()
  FOR Cnt := 1 to 5
    IF ! N_ISSLOCK('SEMAPHORE-' + STR(Cnt,1))
      RETURN .T.
    ENDIF
  NEXT Cnt
RETURN .F.



See Also: N_CHECKS() N_SLOCK()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson