$Bind List: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 14: Line 14:
The third argument is the user number of the user for which bound semaphores are to be returned. This is an optional argument and defaults to -1 which means return semaphores bound by all users.
The third argument is the user number of the user for which bound semaphores are to be returned. This is an optional argument and defaults to -1 which means return semaphores bound by all users.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %RC = $Bind_List(olist, sem_name, user_num)
<p class="syntax"><section begin="syntax" />%rc = $Bind_List(olist, sem_name, user_num)
<section end="syntax" /></p>
<section end="syntax" /></p>
<p class="caption">$Bind_List Function
<p class="caption">$Bind_List Function

Revision as of 21:21, 16 October 2012

Return list of bound semaphores onto a $list

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $Bind_List function.

This function retrieves semaphores bound with $Bind by a specific or all users.

The $Bind_List function accepts three arguments and returns a number indicating the success of the function.

The first argument is the output $list identifier. If the output $list is not empty data is added to the end of the output $list. This is a required argument.

The second argument is the name of the semaphore for which information is to be returned. This argument can contain a single specific semaphore name or it can contain a wildcard string that matches a number of semaphores. This is an optional argument and defaults to "*" which means to return all semaphores bind by all or a specific user.

The third argument is the user number of the user for which bound semaphores are to be returned. This is an optional argument and defaults to -1 which means return semaphores bound by all users.

Syntax

<section begin="syntax" />%rc = $Bind_List(olist, sem_name, user_num) <section end="syntax" />

$Bind_List Function

%RC is a number of items added to %OLIST, or is a negative error code.

>= 0 - Number of bound semaphores returned -3 - $list full or out of CCATEMP All other errors result in request cancellation

$Bind_List return codes

Output $list format

Offset Contents 0-4 The user number of the user that has the semaphore bound represented as a string with leading zeros included. 5-14 The userid of the user that has the semaphore bound represented as a string padded with trailing blanks. 15-end The name of the bound semaphore.

The semaphore name specified in the second argument can be an explicit name or it can contain the following wildcard characters:

* Matches any number of characters including none
? Matches any single character
" Indicates that the next character must be treated literally even if it is a wildcard character.

For example, "C*D" matches "CUSTID", "COD" or "CLOD". "S??T" matches "SALT", "SLOT" or "SORT". "E"*CONCRETE" matches "E*CONCRETE".

The following code fragment retrieves all semaphores bound by the current user where the semaphore name ends with the letters "_TEMP" into a $list and sorts the $list by semaphore name.

%RC = $Bind_List(%OLIST, '*_TEMP', $USER) %SLIST = $ListSort(%OLIST, '16,255, A')

$Bind_List is only available in Version 6.0 and later of the Sirius Mods.

Products authorizing $Bind_List