Ray Rodrick wrote:

> Hi,
>
> I am after some advice on the best way to do this.
>
> I have a form with 3 columns by 10 rows of fields, which is a window
> into 100 rows.
> The user scrolls up/down by 10 rows at a time.
> Columns 1 & 2 are fixed length (only the data changes).
> Column 3 is an input field.
> My app is VERY TIME sensitive.
>
> When the user scrolls, I have to update all the fields.   Initially I
> filled the event queue so in order to reduce the number of events, I
> set the fields in columns 1 & 2 to point to my array (using
> FldSetTextPtr).   That way, I can update any of these values directly
> and do a FrmDrawForm to refresh the screen.
> Question 1:   Is this legitimate ?    Since the pointer is to my array
> these should remain persistant ???

Sounds like it should be ok given that cols 1 & 2 are not editable and
are single line.

>
>
> Column 3 fields are user updateable, so I use FldDirty to see if the
> field has been changed, and if so I do FldGetTextPtr, StrCopy to my
> array, and FldSetDirty false.   To update the fields (all 10 during a
> scroll, etc) I do a FldFreeMemory, a FldInsert, and FldSetDirty false.
>
> Question 2:   Is this legitimate ?   Is there a better way ?

This might be the problem 'cause the ptr rule has been broken. The
PalmOS doco. reads:

"Since the field cannot resize a pointer (only handles can be resized),
the field must be not editable and must be single line. If the field is
editable or has more than one line, an error occurs."

Use a handle for column 3.

>
>
> I save the FrmObjectPtr for all fields in an array when the form is
> first loaded.   The form is never removed (I do FrmPopupForm and
> FrmReturnToForm).
> Question 3:   Is this legitimate ?   Is the FrmObjectPtr always
> persistant throughout the life of the form ?

So far as I know. If it was not then you would have to lock down a
handle to obtain a form's pointer.

>
>
> Any help or comments would be appreciated.   Something I am doing is
> wrong as gremlins0 does indeed crash after about 3000 loops.

I think its 'cause you're using ptrs instead of handles for column 3.

Regards,
--
Christopher Hunt
Class Action Pty. Ltd.

Are you a time zone traveler that owns a Palm(tm) connected organizer?
Check out http://www.classactionpl.com/TimeTraveler/index.htm

Reply via email to