Line-by-line Anatomy of DB.c
(Cont.)
if ( recH = (MemHandle) DmGetRecord( db, curRec ) )
This function MemHandle DmGetRecord( DmOpenRef dbP, UInt16 index ) returns a handle to a record by index and mark the record busy.
dbP
:
DmOpenRef
to open database
index
:
Which record to retrieve
CtlGetValue( ctl )
This function Int16 CtlGetValue( const ControlType *controlP ) returns the current value of the specified control.
For most controls, the return value is either 0 (off) or 1 (on).
controlP
:
Pointer to a control object. (See ControlType.)
CtlSetValue(ctl, value);
This function void CtlSetValue( ControlType *controlP, Int16 newValue ) sets the current value of the specified control.
If the control is visible, it's redrawn.
controlP
:
Pointer to a control object. (See ControlType.)
newValue
:
New value to set for the control.
For graphical controls, push buttons, or check boxes, specify 0 for off, nonzero for on.
FldGetTextPtr( fld );
This function Char *FldGetTextPtr( const FieldType *fldP ) returns a locked pointer to the field's text string or NULL
if the field is empty.
fldP
:
Pointer to a field object (FieldType structure).
The pointer returned by this function can become invalid if the user edits the text after you obtain the pointer.
Do not modify the contents of the pointer yourself.
If you change the text while it is being used by a field, the field's internal structures specifying the text length, allocated size, and word wrapping information can become out of sync.