At 11:07pm -0800 99-11-11, Palm Developers Forum List wrote:
>Date: 11 Nov 1999 09:35:40 -0800
>From: "Michael S. Davis" <[EMAIL PROTECTED]>
>Subject: Invalid Field Length Errors ?
>
>
>I'm still wondering what the criteria for getting this error is:
>line 100, "invalid field length".
>
>Often the string that is displayed in a field is changed. And
>as a result the pointer might be changed.
>
>1) Is there a requirement that the length of the string must
>be less than max char attribute? Or

This is currently not strictly enforced everywhere in the field code, 
but if you're modifying the text contents manually, then you should 
make sure that StrLen(fldP->text) is <= fldP->maxChars. Eventually I 
expect that this type of field consistency check will be done 
throughout the field code.

>2) That the string must be less than some unspecified length? Or,
>
>3) Are there other things that can cause this error?
>
>I need to fix a few of these errors and it doesn't seem like
>the problem is caused by violating 1.

This error will be displayed if StrLen(fldP->text) != fldP->textLen. 
So if you manually modify the data in the text block, and thus change 
the length, without also updating the FieldType.textLen field, then 
you'll have a problem.

One additional minor note is that if fldP->textBlockSize is zero, 
this check won't be done, since some apps (including Address) use an 
zero-size field (versus a zero length string, which would have one 
byte of null) to represent an empty field in a record.

-- Ken

Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200 (direct) +1 408-261-7550 (main)

Reply via email to