Hmm . . . at first I agree with you, but on second thought, I don't think it
really matters. Since he converting a UInt32 to a string, he needs an 11
char array for any given number. If the handle he gets from the field is
not 11 chars, there is a _potential_ problem. Of course, as long as the
day/month/year values he is passing in are valid, there will never be a
day/month > 31 . . . but better to be safe than sorry, esp if he wants the
code to be reusable in the future.
In summary, both "==" and "<" should work fine, given the assumptions here .
. but based on his follow-up post, it sounds like that might not be the
problem :)
Cheers,
-DGA
> I would use this:
>
> if (MemHandleSize (oldhand) < 11)
> {
> MemHandleResize (oldHand, 11);
> }
>
> Make sure the size is large enough! :)
>
> Max
>
> --- "Avilla, Dane" <[EMAIL PROTECTED]> wrote:
>
> > Hope this helps . . .
> >
> > -DGA
> >
> > > oldhand = FldGetTextHandle(fld);
> > >
> > > if (!(oldhand)) oldhand = MemHandleNew(11);
> > else
> > if (MemHandleSize (oldhand) != 11)
> > {
> > MemHandleResize (oldHand, 11);
> > }
> > > fldptr = MemHandleLock(oldhand);
> > >
> > > StrIToA(fldptr, newtime);
> > >
> > > FldSetTextHandle(fld, oldhand);
> > > FldDrawField(fld);
> > > MemHandleUnlock(oldhand);
> >
> > --
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/