MAINSAIL Language Manual, Section 32.21

previous   next   top   contents   index   framed top   this page unframed


32.21. $classInfo

Figure 32–16. $classInfo
BOOLEAN
PROCEDURE   $classInfo  (POINTER p;
                         
PRODUCES OPTIONAL STRING
                             
className,fieldNames,
                             
fieldTypes;
                         
PRODUCES OPTIONAL
                             
POINTER($classDscrq;
                         
OPTIONAL POINTER($areaarea);

p is a POINTER to a dynamic record, CLASS descriptor, or data section. If p is invalid, FALSE is returned; otherwise, TRUE is returned, and the PRODUCES parameters are set. className is set to the name (all upper case) of the associated CLASS (i.e., to the same value returned by $className(p)). fieldNames is set to the non-PROCEDURE field names (all upper case) separated by eols, fieldTypes to the field type codes separated by eols. q is set to the CLASS descriptor for p (the CLASS descriptor for p may be obtained more efficiently by calling $dscrPtr). A unique CLASS descriptor exists for each CLASS currently in use. area specifies the destination area if any new STRING text is generated; see Section 29.4.

If a field is a data field of an explicitly sized type, the corresponding entry in fieldTypes is an extended type code, not a base type code (see Appendix A).

Example 32–17. Use of $classInfo
CLASS c (INTEGER iREAL xSTRING sPOINTER(clink);
...
p := new(c);
$classInfo(p,className,fieldNames,fieldTypes);

The PRODUCES parameters are set as follows:

className = "C"
fieldNames = "I<eol>X<eol>S<eol>LINK"
fieldTypes = "2<eol>4<eol>8<eol>11"

(where 2 = integerCode, 4 = realCode, 8 = stringCode, 11 = pointerCode). <eol> indicates an embedded end-of-line STRING.

Section 50.1 describes a version of $classInfo, $classInfoExtended, that provides additional information about a CLASS. However, $classInfoExtended is a temporary feature.


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 32.21