Die andere Methode würde übrigens so funktionieren ;).
Spoiler anzeigen
#include <GUIConstants.au3>
#include <String.au3>
Global $aCodec[26][2] = [['A', 'Y'],['B', 'P'],['C', 'L'],['D', 'T'],['E', 'A'],['F', 'V'],['G', 'K'],['H', 'R'],['I', 'E'],['J', 'Z'],['K', 'G'],['L', 'M'],['M', 'S'],['N', 'H'],['O', 'U'],['P', 'B'],['Q', 'X'],['R', 'N'],['S', 'C'],['T', 'D'],['U', 'I'],['V', 'J'],['W', 'F'],['X', 'Q'],['Y', 'O'],['Z', 'W']]
[/autoit] [autoit][/autoit] [autoit]$hWnd = GUICreate("Translate", 200, 60)
$cInput = GUICtrlCreateInput("", 5, 5, 190, 20)
$cButton = GUICtrlCreateButton("Translate", 5, 30, 190, 25)
GUISetState()
While True
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $cButton
$sText = GUICtrlRead($cInput)
If $sText = "" Then ContinueLoop
$aSplit = StringSplit(StringUpper($sText), "")
$sTextNew = ""
For $i = 1 To $aSplit[0]
$bCharFound = False
For $i2 = 0 To 25
If $aSplit[$i] == $aCodec[$i2][0] Then
$sTextNew &= $aCodec[$i2][1]
$bCharFound = True
ExitLoop
EndIf
Next
If Not $bCharFound Then $sTextNew &= $aSplit[$i]
Next
GUICtrlSetData($cInput, _StringProper($sTextNew))
EndSwitch
WEnd