Jump to content

Recommended Posts

Posted

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

 

Posted
3 minutes ago, Au3Builder said:

there is no such thing as GuiCtrlGetData. I believe you meant GUICtrlRead.

Thanks.  Strange, the error said that the error was in StringReplace. Thank you.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...