> void AdjustFieldFont(Word fldID, int width) {
>     FormPtr     form;
>     FieldPtr    fldP;
> 
>     form = FrmGetActiveForm();
>     fldP = FrmGetObjectPtr(form, FrmGetObjectIndex(form, fldID));
>     if(FldGetTextLength(fldP)>width) {
>         FldSetFont(fldP, stdFont);
>     }
>     else {
>         FldSetFont(fldP, largeFont);
>     }
> }

> What can cause the error: "app has just read from memory location
> zero, NULL" when changing font size.  Both fields have characters
> inserted from global arrays of characters.

Normally this error occurs when the text handle is not properly
set. You might want to check with FldGetTextHandle before getting
the text length. The reason for one field having a handle and the
other not might be that the first one had the focus.

Hope this helps,
        Holger Klawitter
--
Holger Klawitter                                     +49 (0)251 484 0637
[EMAIL PROTECTED]                             http://www.klawitter.de/

Reply via email to