Jump to content

Amixg

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Amixg

  1. Thanks. Strange, the error said that the error was in StringReplace. Thank you.
  2. Hi! I have another problem with AutoIT. You see, I'm still the one who's just starting out with this great programming language. I have a problem with AutoIT, it seems not to recognize the "StringReplace" function even when it is by default. The code was made half in KODA and half of my own. It is a software programmed for the Italian language (I am Italian) and translate the SMS language into Italian correct. Would you help me? Thanks in advance. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $hull = "hello" StringReplace($hull, "hello", "hellx") $Form1 = GUICreate("Linguaggio SMS A Italiano", 507, 498, 192, 124) $Edit1 = GUICtrlCreateEdit("", 24, 40, 465, 177) GUICtrlSetData(-1, "") $Label1 = GUICtrlCreateLabel("Inserisci qui il testo che non riesci a capire:", 24, 8, 205, 17) $Label2 = GUICtrlCreateLabel("Ecco il testo tradotto(non toccare questo campo):", 27, 237, 237, 17) $Edit2 = GUICtrlCreateEdit("", 24, 264, 465, 137) GUICtrlSetData(-1, "") $Button1 = GUICtrlCreateButton("Traduci", 104, 424, 249, 49) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 StringReplace(GUICtrlGetData($Label1), "qlc", "qualcuno") StringReplace(GUICtrlGetData($Label1), "qls", "qualcosa") StringReplace(GUICtrlGetData($Label1), "ke", "che") StringReplace(GUICtrlGetData($Label1), "x", "per") StringReplace(GUICtrlGetData($Label1), "pls", "per favore") StringReplace(GUICtrlGetData($Label1), "tu6", "tu sei") StringReplace(GUICtrlGetData($Label1), "zzz", "mi fai dormire") StringReplace(GUICtrlGetData($Label1), "hagn", "Buonanotte") StringReplace(GUICtrlGetData($Label1), "tvtb", "Ti voglio tanto bene") StringReplace(GUICtrlGetData($Label1), "tat", "Ti amo tanto") StringReplace(GUICtrlGetData($Label1), "lafs", "Amore a prima vista") StringReplace(GUICtrlGetData($Label1), "fli?", "Flirtiamo?") StringReplace(GUICtrlGetData($Label1), "msidt", "Mi sono innamorato di te") StringReplace(GUICtrlGetData($Label1), "ba", "Bacio") StringReplace(GUICtrlGetData($Label1), "midi", "Mi dispiace.") StringReplace(GUICtrlGetData($Label1), "ntm", "Non ti merito") StringReplace(GUICtrlGetData($Label1), "tdp", "Togliti dai piedi.") StringReplace(GUICtrlGetData($Label1), "amò", "Amore") StringReplace(GUICtrlGetData($Label1), "ap", "A presto!") StringReplace(GUICtrlGetData($Label1), "cmq", "comunque") StringReplace(GUICtrlGetData($Label1), "cvd", "Ci vediamo dopo") StringReplace(GUICtrlGetData($Label1), "Tvb", "Ti voglio bene") StringReplace(GUICtrlGetData($Label1), "nn", "non") StringReplace(GUICtrlGetData($Label1), "risp", "rispondimi") StringReplace(GUICtrlGetData($Label1), "cel", "cellulare") StringReplace(GUICtrlGetData($Label1), "dom", "qualcosa") StringReplace(GUICtrlGetData($Label1), "nm", "numero") StringReplace(GUICtrlGetData($Label1), "fv", "favore") StringReplace(GUICtrlGetData($Label1), "-male", "meno male") StringReplace(GUICtrlGetData($Label1), "disc", "discoteca") StringReplace(GUICtrlGetData($Label1), "se#", "settimana") StringReplace(GUICtrlGetData($Label1), "+ o -", "più o meno") StringReplace(GUICtrlGetData($Label1), "ts", "torno subito") StringReplace(GUICtrlGetData($Label1), "tvtbcoa", "Ti voglio tanto bene come amica") EndSwitch WEnd
  3. Thanks, friend.
  4. I would like to create a fairly basic programming language in AutoIt based on an unknown programming language called Vatical. I am at the beginning of this fantastic programming language, and many times I do not understand programming errors, as in this case. I have a problem with a script, when I compile the script I get an error: "EndSwitch statement with no matching switch statement". Still, there is a Switch in the code! Would you help me? Thanks in advance. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> ; GUI created by Koda. $currentfile = "" $variables = "" ; All variables of Vatical. Func ParseIt($filetoparse) $sct = ["test"] _FileReadToArray($filetoparse, $sct) For $vt = 0 To UBound($sct) If $sct[$vt] <> "" Then If StringTrimLeft($sct[$vt], Len($sct($vt))-1) <> "$" Then If UpperCase(StringTrimLeft($sct[$vt], Len($sct($vt))-5)) == "PRAY " Then MsgBox(1, StringTrimRight($sct[$vt], 5), "Dialog") ElseIf UpperCase(StringTrimLeft($sct[$vt], Len($sct($vt))-4)) == "EXIT" Then MsgBox(1, "Script ended by: istruction", "Script ended: " & @TIME) Exit For Else MsgBox("Unrecognized command: " & $sct[$vt], "Error: 3") EndIf EndIf EndIf Next EndFunc $Form1 = GUICreate("Vatical Language", 469, 128, 206, 123) $Group1 = GUICtrlCreateGroup("Vatical 4.0", 8, 8, 449, 105) $Button1 = GUICtrlCreateButton("Select Vatical File", 56, 40, 121, 25) $Input1 = GUICtrlCreateInput("", 200, 40, 241, 21) $Button2 = GUICtrlCreateButton("Load Script", 56, 72, 385, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $ertt = FileOpenDialog ("Vatical Language Open", ".", "Vatical Files(*.vat) | All Files(*.*)") If @error <> 0 Then GUICtrlSetData($Input1, $ertt) $currentfile = $ertt Else MsgBox(1, "Error: file dont exists in this directory.", "Error: 1") Exit EndIf Case $Button2 If FileExists($currentfile) And $currentfile <> "" Then ParseIt($currentfile) Else MsgBox(1, "Error: you dont have selected a file.", "Error: 2") End If EndSwitch WEnd
×
×
  • Create New...