0
I’d be very grateful if you could help me!
It only gives the value of the letter typed in Edit if I type one
time, if I try two or more gives error, I would like to know in
that I’m wrong, I’d like to show the value of the letter
repeatedly as you type it into Edit.
digitaria no teclado: zAAAAAB zzzz no Edit exibiria: 5111111 5555 function m (x:string):string; var y:string; z,w:integer; begin if(x='A') or (x ='a') or (x='Â') or (x='â') or (x='ã') then y :='1'; if(x='b') then y:='1'; if(x='c') then y:='1'; if(x='z') then y:='5'; ...... Result:=''; for w:=1 to Length(x) do begin z:=0; repeat z:=z+1; until x[z]=x[z]; Result:=Result+y[w]; end; end; procedure TForm1.Edit1Change(Sender: TObject); begin memo1.text:=(m(edit1.text)); end;
I think the z variable and looping with repeat/until are unnecessary and if you repair the z variable is not being used to mount the result.
– imex
And the Ifs to assign a value to the variable y must stay within the looping for/do to evaluate each character of the string x and for that the variable w must be used as Indice. The y variable must be used without index since it will always have a single character. Also consider adding code to add some value to the variable y when the evaluated character is different from all that are predicted.
– imex
hi imex, thanks for your tips, wow, I’m having a lot of work and difficulty to assemble this function alone I started in programming studies a short time, I’m still an apprentice, I would code in html, you could help me if it’s too much trouble?
– Juliana