Initializing help system before first use

findident

Purpose
Find an identifier in the dictionary.
Synopsis
function findident(name:string, value:any):integer
function findident(name:string, value:any, exptype:integer):integer
function findident(name:string, values:list of any):integer
Arguments
name 
Identifier
value 
Union where the value of the dictionary entry is returned
values 
List of all entities having this name as a list of unions
exptype 
Expected type
Return value
Aggregated type information of the returned dictionary entry, 0 if the identifier cannot be found or -1 if the value cannot be saved in the value variable.
Example
The following:
public declarations
 glbint:integer
 val:any
 procintarg=procedure(integer)
end-declarations

public procedure doit(i:integer)
 writeln("Got ",i)
end-procedure

writeln("glbint=",glbint)
if testtype(findident("glbint",val),STRUCT_REF+integer.id) then
 val.integer:=123
end-if
writeln("glbint=",glbint)

if findident("doit",val,procintarg.id)<>0 then
 val.procintarg(33)     ! Call the procedure
end-if
produces this output:
glbint=0
glbint=123
Got 33
Further information
1. This function returns the dictionary entry of a given identifier along with its type. The returned type information is bit encoded and includes a type code and a structure that can be decoded using getstruct, geteltype and gettypeid. Alternatively, testtype might be used to filter this value.
2. When using the second form, the function succeeds only if it can find an entity of the provided type exptype. Note that the value returned in this case is not necessarily exptype ( i.e. the function has succeeded when its return value is positive).
3. The last form of the function makes it possible to retrieve all overloaded versions of a subroutine. As for the previous case, the function has succeeded if its return value is positive.
4. If the identifier corresponds to a global entity of a basic type ( i.e. integer, real, boolean or string) the resulting union value will contain a reference to the actual variable and any change to its value will be applied to the global entity.
Related topics
Module

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.