Recent

Author Topic: Pegar valores também das letras acentudas  (Read 2183 times)

aacs

  • New member
  • *
  • Posts: 7
Pegar valores também das letras acentudas
« on: February 13, 2021, 06:28:54 am »
Precisaria pegar  valores das letras acentuadas ela retorna um valor diferente apenas para as acentudas, as sem acentos ela funciona certinho.

E não tem problema se for uma outra função diferente dessa, desde já agradeçido.







obrigado!

Code: Pascal  [Select][+][-]
  1. function valor(Str:String):String;
  2. const
  3. Lin1:String = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÆÁÂÅÃÄáâæàåãäÉÊÈÍÎÌÏÇÓÔÒØÖÞÚÛÙÜæáâåãäáâæàåãäéêèíîìïçóôòøöþúûùü';
  4. Lin2:String = '123456789123456789123456781234567891234567891234567811111111111115559999366666633331111111111111555999936666663333';
  5.  
  6. var
  7. x,y:integer;
  8. begin
  9.    Result:='';
  10.    for y:=1 to Length(Str) do
  11.      begin
  12.        x:=0;
  13.        repeat x:=x+1;
  14.        until Str[y]=Lin1[x];
  15.        Result:=Result+Lin2[x]
  16.      end;
  17. end;
  18.  
  19. procedure TForm1.Edit1Change(Sender: TObject);
  20. begin
  21.    Memo1.clear;
  22.    Memo1.text:=(valor(Edit1.Text));
  23. end;

[Edited to add code tags :-]
« Last Edit: February 16, 2021, 11:07:12 pm by aacs »

 

TinyPortal © 2005-2018