Ok, I have looked at everything I can find and the only difference
That I can see with this FldSetFont() issue is the difference
in attributes of the fields.
Since, this function worked with form2 and field1 and not
with form2 and field2, I decided to make the field2 attributes
the same as field1. Sure enough, if the field2 is changed
to a multi-line field, like field1, I do not get the error.
The error was "app has just written to low memory, "NULL""
Why does this function fail on a single line field? I have ruled
out all other attributes as the casue. Only lingle-line fields
cause this error when AdjustFieldFont() is executed.
Mike
On Mon, 8 Nov 1999, Holger Klawitter wrote:
>
> > 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/
>
>
>
----------------------------------------------------
Shoot-to-Win
Protect the 2nd Amendment
----------------------------------------------------