Einzelnen Beitrag anzeigen

kujin1000
(Gast)

n/a Beiträge
 
#1

Ich verstehe eine kleine Sache bei einer Funktion nicht..

  Alt 21. Mai 2008, 20:22
Hallo leute,
ich habe hier eine Funktion, die ich leider nicht richtig verstehe ,
vielleicht könnt ihr mir kurz helfen:
Delphi-Quellcode:
procedure TVigenere.SetSecretText(aSecretText: String);
var
  I: Integer;
begin
  //SecretText formatieren
  aSecretText := StringReplace(aSecretText, 'Ä', 'AE', [rfReplaceAll]);
  aSecretText := StringReplace(aSecretText, 'ä', 'AE', [rfReplaceAll]);
  aSecretText := StringReplace(aSecretText, 'Ö', 'OE', [rfReplaceAll]);
  aSecretText := StringReplace(aSecretText, 'ö', 'OE', [rfReplaceAll]);
  aSecretText := StringReplace(aSecretText, 'Ü', 'UE', [rfReplaceAll]);
  aSecretText := StringReplace(aSecretText, 'ü', 'UE', [rfReplaceAll]);
  aSecretText := StringReplace(aSecretText, 'ß', 'SS', [rfReplaceAll]);
  For I := 1 to 255 do
    If ((I < 65) or (I > 90)) and ((I < 97) or (I > 122)) then aSecretText := StringReplace(aSecretText, Chr(I), '', [rfReplaceAll]);
  For I := 97 to 122 do
    aSecretText := StringReplace(aSecretText, Chr(I), Chr(I-32), [rfReplaceAll]);
  SecretText := aSecretText;
end;
Diese Funktion brauche ich für einen Verschlüsselungsprogramm(genauer gesagt für Vigenere). Ich verstehe den letzten Teil nicht...
Delphi-Quellcode:
For I := 1 to 255 do
    If ((I < 65) or (I > 90)) and ((I < 97) or (I > 122)) then aSecretText := StringReplace(aSecretText, Chr(I), '', [rfReplaceAll]);
  For I := 97 to 122 do
    aSecretText := StringReplace(aSecretText, Chr(I), Chr(I-32), [rfReplaceAll]);
  SecretText := aSecretText;
Was bewirkt das Charakter dort? und wieso in der zweiten Schleife -32 ?
Vielen Dank
  Mit Zitat antworten Zitat