

IPos:= Pos( ' ', sText ) // Find next occurance

If iCur>= iPos then Dec( iCur ) // Was text cursor after that spot? Should move, too. IPos:= Pos( ' ', sText ) // Find first occurance

ICur:= edt.SelStart // Remember text cursor position Kill all spaces, so it doesn't matter how many are in there Sender might be nil in rare conditions ILen, iPos, iCur: Integer // Text length, Character to inspect, Text cursor position Have an empty form, add a TEdit and make this its OnChange event: procedure TForm1.Edit1Change( Sender: TObject ) Kill all spaces on purpose and put them anywhere you want for optic reasons.Īlso don't make the mistake to use several TEdits for each block of text, as that will disrupt anyone who wants to paste the clipboard content of the long serial(?) at once - I've seen software installations doing this and it was always a pain.Don't rely on keyboard versus mouse input.Since the text you want to operate on is rather short you can use a TEdit directly and react upon changes to its text: Don't use TMaskEdit and its horrible optics and limitations.
