Line-by-line Anatomy of Forms.c
(Cont.)
fld = (FieldPtr) FrmGetObjectPtr ( FrmGetActiveForm( ), obj );
The function void *FrmGetObjectPtr( const FormType *formP, UInt16 objIndex ) returns a pointer to the data structure of an object in a form.
formP
: Pointer to the form object (FormType structure)
objIndex
: Index of an object in the form.
You can obtain this by using FrmGetObjectIndex( ).
h = (VoidHand) FldGetTextHandle( fld );
The function MemHandle FldGetTextHandle( const FieldType *fldP ) returns a handle to the block that contains the text string of a field or NULL
if no handle has been allocated for the field pointer.
fldP
: Pointer to a field object (FieldType structure)
h = MemHandleNew( FldGetMaxChars( fld )+10 );
This function UInt16 FldGetMaxChars( const FieldType *fldP ) returns the maximum number of bytes the maxChars
field in FieldType accepts.
fldP
: Pointer to a field object (FieldType
structure)
The function MemHandle MemHandleNew( UInt32 size ) allocates a new movable chunk in the dynamic heap and returns a handle to it, or 0 if unsuccessful.
size
: The desired size of the chunk
ErrFatalDisplayIf( !h, "No Memory" );
The macro #define ErrFatalDisplayIf( condition, msg ) displays an error alert dialog if condition
is true
and error checking is set to partial or full.
condition
: A boolean value.
If true
, display the error.
msg
: Error message text as a string