Slide 8.4: Line-by-line anatomy of Forms.c
  Slide 8.6: Line-by-line anatomy of Forms.c (cont.)
  Home


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.
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.
h = MemHandleNew( FldGetMaxChars( fld )+10 );
This function UInt16 FldGetMaxChars( const FieldType *fldP ) returns the maximum number of bytes the maxChars field in FieldType accepts. 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.
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.