%NSPC_FIND

Find an entry in a symbol table

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
access_code = %NSPC_FIND(id, [entry_name], [data][, found_id])

access_code

If entry_name is specified, this function returns either the access code of the found entry or zero if not found. If entry_name is not specified, the number of entries within id is returned. (n)

id

The ID of the symbol table to search. (n)

entry_name

(optional) The name of the entry for which to search. (a)

data

(optional) The returned user-defined data associated with the entry. (a)

found_id

(optional) The returned symbol table ID. (n)

The %NSPC_FIND function searches for an entry within a symbol table.

If entry_name is specified, id is searched for the entry entry_name.

If data is specified and an entry is found, data is loaded with the user-defined data associated with the entry. The maximum size of data is 100 characters, as defined in %NSPC_OPEN.

Note

Because an entry’s access code can change for every add, delete, or move within a symbol table, a FIND should always immediately precede any usage of an entry’s access code.

The following example searches for entry new_user in symbol table user_id. If new_user is not found, it adds it to the symbol table.

if (.not. %nspc_find(user_id, new_user)
  user_id = %nspc_add(user_id, new_user, user_data)