0

text========"everyone delphi fans"

i need help on delphi how to count the number of character enter by a user for exmaple if a user enters 2 in editbox1 and enters 5 in editbox2 then the program should display this using the above text in a memo.

"very"

meaning that the number specify in text 1 is is the beginning and the number specify in text 2 marks the ending.

please guys am new here help meeeeeeeeeeeeeeeeeeeeeeee

6
Contributors
6
Replies
7
Views
8 Years
Discussion Span
Last Post by Jacob777
0

Hook keyboard keypress event, increase a counter everytime a key is pressed, I think that would do the trick

Thanks

0

text========"everyone delphi fans"

i need help on delphi how to count the number of character enter by a user for exmaple if a user enters 2 in editbox1 and enters 5 in editbox2 then the program should display this using the above text in a memo.

"very"

meaning that the number specify in text 1 is is the beginning and the number specify in text 2 marks the ending.

please guys am new here help meeeeeeeeeeeeeeeeeeeeeeee

ok - add an OnChange event - and make both text boxes point to this event handler

const
stSOURCE :string = "everyone delphi fans";

Procedure Text1OnChange(sender)
var inStart, inEnd :integer;
stOutput:string;
begin
inStart:= StrToInt(text1.text);
inEnd:= StrToInt(text2.text);
//should check values here....ie must be numbers, etc
stOutput:=copy(stSource, inStart,inEnd);
//put output somewhere
label1.caption:=stOutput;
end;

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.