> >I have tested my app as a PalmIIIx using Bebug Rom 3.0.  Every
> >thing tests ok.
> 
> That's surprising; Palm OS 3.0 didn't support the Palm IIIx device :-)
> Different processor. But anyway...

Oops!  I was using 3.0 for development.  My IIIx actually  used 3.1 
as you know:-)

> 
> >1) Field.c, Line: 123, Invalid insertion point position.
> 
> That'd be shown if the field's insertion point position (line number) was
> greater than the number of lines visible on the field.  If you'd recently
> been changing the field's contents, perhaps that isn't being done
> correctly.  Otherwise, I'd suspect that you're overwriting the field's
> data structures... perhaps you're copying text into a label which isn't
> long enough, or have an uninitialized variable, or something like that.

I thought that insertion point position was a number between the 
beginning of the field to the end of the field.  How does that relate 
to rows?  Anyway, yes, the field was a little too small in height.

> 
> >2) Field.c, Line: 136, Invalid Field Length.
> 
> This fires if StrLen(fld->text) != fld->textLen.  Are you sure the string
> is null terminated? Or are you changing the text directly without calling
> FldSetTextPtr or something similar so that the field knows that you've
> been changing its data?  Use the debugger to look at the memory to find
> out for sure what's going on.  Or it could be memory corruption again.

This one is odd.  I set the field text with SetFieldText below and if
I comment out the FldSetSelection() (don't think this is needed 
because there is nothing to select, since the field is not editable), 
the problem completely goes away.  But I am curious.

Does StrLen(fld->text) have to = fld->textLen or be less than.  It 
seems like fields are changed often.  Does this mean that I have to 
change the field attributes (textLen) each time I change a field.

I typically use the function below to change the text in a field:
 
void SetFieldText(Word id, char *s) {
    FormPtr frmp;
    FieldPtr fldp;
    FieldAttrType fa;

    frmp=FrmGetActiveForm();
    fldp=FrmGetObjectPtr(frmp, FrmGetObjectIndex(frmp, id));
    FldGetAttributes(fldp, &fa);

    /* if editable, do insert, if not, set poiner */
    if (fa.editable == TRUE){
        FldDelete(fldp, 0, FldGetTextLength(fldp));
        FldInsert(fldp, s, StrLen(s));
    }
    else{
        //FldSetSelection(fldp, 0,0);   // no field length error if I 
comment this out
        FldSetTextPtr(fldp, s);
    }
    FldDrawField(fldp);
}

--
-----------------------------------------------------------------
Discussion Group:        http://www.halcyon.com/ipscone/wwwboard/

Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------

Reply via email to