Initializing help system before first use

getstruct

Purpose
Get the structure of a type.
Synopsis
function getstruct(u: union): integer
function getstruct(tid: integer): integer
Arguments
A union
tid 
A type ID
Return value
Type structure as an integer. Possible structures are:
STRUCT_CONST 
A constant
STRUCT_REF 
A reference
STRUCT_ARRAY 
An array
STRUCT_SET 
A set
STRUCT_LIST 
A list
STRUCT_ROUTINE 
A subroutine
STRUCT_NATTYPE 
A native type
STRUCT_PROBLEM 
A problem
STRUCT_RECORD 
A record
STRUCT_USRTYPE 
A user type
STRUCT_UNION 
A union
-1 
If the provided parameter is not a valid type ID or the union is not defined
Example
declarations
 MYSET=set of integer
 s: MYSET
 u1,u2,u3: any
end-declarations
  ...
u1:=s
u2:="bla"
writeln("ElType of MYSET: ", getstruct(MYSET.id),   ! = STRUCT_SET=12288
        "\nElType of u1: ", u1.struct,              ! = STRUCT_SET=12288
        "\nElType of u2: ", u2.struct,              ! = STRUCT_CONST=0
        "\nElType of u3: ", u3.struct)              ! = -1
Further information
1. This function retrieves the structure (constant, reference, array, set, list, or subroutine) of a type represented by its ID or by the value stored in a union. The type ID of an element of a non-scalar type may be obtained with geteltype.
2. When applied to the ID of a basic type (integer, real, string or boolean) this function will return STRUCT_CONST although a variable of these types is a reference and a union may hold either a reference or a constant for basic types.
3. There are 2 versions of this routine: when used with a union the information reported comes from the current value of this union ( -1 is returned if the union is not initialized). If applied to an integer the function expects this integer to be a type ID ( -1 is returned if this value does not correspond to a type ID).
Related topics

© 2001-2022 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.