--- Joanne C <[EMAIL PROTECTED]> wrote: > > The problem is like what the subject has said; let's say > I have a field, and there is a current selection now. I > am trying to save the selection into a string. Seems easy, > but I have been going round and round. > > I tried FldGetSelection, but it is a void function and returns > nothing;
No, FldGetSelection returns 2 UInt16's: the start and end position of the selected text. If you use FldGetSelection() and FldGetTextPtr() you should be able to get the selected text. > I am thinking now perhaps I should play with pointers, > but I am not sure how to start . You can't hardly do anything in C without "playing with pointers". :) Here's an example (without any error checking): text = FldGetTextPtr( fldP ); FldGetSelection( fldP, &startPosition, &endPosition ); StrNCopy( result, text+startPosition, endPosition - startPosition); result[endPosition - startPosition] = '\0'; __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
