Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> semvalueincrement()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SemValueIncrement()
------------------------------------------------------------------------------
 Purpose:
 Increment a semaphore value by 1.

 Syntax:
 bResult = SemValueIncrement( dwSemID )

 Parameters:
 dwSemID The semaphore ID number.

 Returns:
 A boolean value (TRUE or FALSE).

 The CA-Clipper name for this function is:
 SemValInc()

 Description:
 SemValueIncrement() returns TRUE if the value of the semaphore
 specified by ID number dwSemID is incremented successfully.

 Returns FALSE if not, or if an error occurs.

 Example:
 // To open a semaphore called "UPDATE_SEM" with an initial value 24,
 // decrement it to use the resource and then increment it again:
 dwSemID = SemOpen( "UPDATE_SEM", 24 )
 if ( NWErrorGet() = 0 )
    if ( SemValueDecrement( dwSemID ) )
       ....   // Perform function
       if ( SemValueIncrement( dwSemID ) )
          ? "Semaphore incremented successfully"
       endif
    endif
 endif

 Notes:
 Semaphore values may be in the range -127 to 127. Attempts to
 increment a semaphore value beyond 127 result in an error.

 If FALSE is returned, check NWErrorGet().
 Note for CA-Clipper:
 IMPORTANT - both positive and negative values are valid semaphore handles,
 except the value NOVERRLONG. Valid semaphore handles can be in the range
 -2147483647 to +2147483647.

See Also: SemValueDecrement() SemValueGet()

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