Function NnetSemVal() Foundation

Retrieves the current semaphore value.

Syntax
NnetSemVal( <nSemaphoreHandle>        , ;
            [<cFileServer|nConnectID>]  ;  // Default: NnetSname()
          ) --> nSemaphoreValue
Return

Returns the value of semaphore <nSemaphoreHandle> or -1 in case of an error.

Description

As long as NnetSemVal() returns a positive value it indicates the number of available openings for the semaphore <nSemaphoreHandle>. Once the return value goes negative it represents the number of workstations waiting in the semaphore queue for semaphores to become available.

NOTE: This function returns -1 on an error condition. This is a functionality fault in the CA-Tools library because -1 is a valid value for a semaphore. However, for compatibility reasons we do the same.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.