This is a double question. I have this code which goes to the line number that I enter in (SForm.SEdit3.Text). My problem now is that I also want the caret to go to the charline in that line number. The charline is entered through (SForm.SEdit4.Text).
My second problem is that I want to check if the entered data for both line and charline is an integer. Because I get an error if the user inputs a char :
procedure TSForm.SBtn3Click(Sender: TObject);
tmpcount, tmpline : word;
tmpline := strtoint(SForm.SEdit3.Text);
if tmpline = 0 then begin
Showmessage('Invalid line number');
tmpcount := MForm.MMemo.Perform(EM_GETLINECOUNT, 0, 0);
if tmpline > tmpcount then
tmpline := tmpcount;
MForm.MMemo.SelStart := MForm.MMemo.Perform(EM_LINEINDEX, tmpline, 0);
MForm.MMemo.Perform(EM_SCROLLCARET, 0, 0);
I hope you can all help me... I will give points to the person who can give solutions to both problems... I need a small code if posible...
Thnx in advance... :D