Hi!
I have a question concerning inserting strings into a field. There is no problem
in preparing a string and then insert it into a field. But I need to insert
several strings one by one and one after another. I have a problem with that. I
can not force the program to write at the end of previous string. Instead it
overwrites the previous string. I attached a sample code. I do not understand
why I can not pass in routine ::FldSetText offset bigger then 0. When I do so,
the program hangs. I would appreciate any help on that.
Regards,
Luke Iwanicki
::FldFreeMemory( fieldP );
if( sTimeStamp != NULL && (::StrLen( sTimeStamp ) > 0 ) )
{
VoidHand textHandle = ::MemHandleNew( ::StrLen( sTimeStamp ) + 1 );
{
PHandleLocker thePtr( (MemHandle)textHandle );
::StrCopy( (Char*)thePtr(), (Char*)sTimeStamp );
}
::FldSetText( fieldP, textHandle, 0, ::StrLen( sTimeStamp ) + 1 );
}
::FldDrawField( fieldP );
::FldSetInsertionPoint( fieldP, ::StrLen( sTimeStamp ) );
::FldFreeMemory( fieldP );
if( sTimeStamp != NULL && (::StrLen( sDescription ) > 0 ) )
{
VoidHand textHandle = ::MemHandleNew( ::StrLen( sDescription ) + 1 );
{
PHandleLocker thePtr( (MemHandle)textHandle );
::StrCopy( (Char*)thePtr(), (Char*)sDescription );
}
::FldSetText( fieldP, textHandle, 0 /* ::StrLen( sTimeStamp ) */, ::StrLen(
sDescription ) + 1 ); // why I can not start from the end of previous string?
}
::FldDrawField( fieldP );
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/