me voila encore
j'ai réussi à faire le scripte
mais il reste quelques petits problèmes dont :
- le programme ne fait qu'une seul opération c'est à dire qu'il remplace une seul fois
comme vous voyer ici
la première fenêtre tout est bon
mais quand j'efface la première entrer "aze" et je met "rty" puis je clic sur bouton1
il me donne un 0 ,
j'ai essayé de régler ce problème avec ce code à la fin des fonctions
Code : Tout sélectionner
$Res2 = $Res
$Res = String("")
$j = 1
$i = 1
$Char = String("")
mais j'ai toujours ce probleme
voici la source
► Afficher le texte
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("My CrYprTeR ", 617, 148, 194, 170)
GUISetBkColor(0xA6CAF0)
$Input1 = GUICtrlCreateInput("Input1", 16, 23, 200, 100)
$Button1 = GUICtrlCreateButton("Button1", 232, 80, 153, 41, $WS_GROUP)
$Radio1 = GUICtrlCreateRadio("A to Q", 248, 24, 113, 17)
$Radio2 = GUICtrlCreateRadio("Q to A", 248, 48, 113, 17)
GUISetState(@SW_SHOW)
Local $Azerty = "azertyuiop"
Local $Qwerty = "qsdfghjklm"
Local $Char, $Res, $j, $i
Local $aAzerty = StringSplit($Azerty, "")
Local $aQwerty = StringSplit($Qwerty, "")
Local $m = 0
Func _atoq()
For $j = 1 To StringLen($Input1)
$Char = StringMid($Input1, $j, 1)
If StringInStr($Azerty, $Char, 1) Then
For $i = 1 To $aAzerty[0]
If $Char == $aAzerty[$i] Then
$Char = $aQwerty[$i]
ExitLoop
EndIf
Next
EndIf
$Res &= $Char
Next
EndFunc
Func _qtoa()
For $j = 1 To StringLen($Input1)
$Char = StringMid($Input1, $j, 1)
If StringInStr($Qwerty, $Char, 1) Then
For $i = 1 To $aQwerty[0]
If $Char == $aQwerty[$i] Then
$Char = $aAzerty[$i]
ExitLoop
EndIf
Next
EndIf
$Res &= $Char
Next
EndFunc
Func _test()
if $m = 1 then
call("_atoq")
ElseIf $m = 2 Then
Call("_qtoa")
Else
SetError(1)
EndIf
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Radio1
$m = 1
Case $Radio2
$m = 2
Case $Button1
$Input1=GUICtrlRead($Input1)
Call("_test")
$Input2 = GUICtrlCreateInput($Res, 399, 23, 200, 100)
EndSwitch
WEnd
et merci d'avoir m'aider
