Login Register






AutoIT Variable filter_list
Author
Message
AutoIT Variable #1
I started learning how to code using AutoIT
I started from basics and I stuck on this little error message.
Variable used without being declared
It sounds easy like to get rid of something or add something.
But I'm not sure.
So thats Why I'm Asking for your help.
Thank You.

Reply

RE: AutoIT Variable #2
You need to declare your variable.
Example for a declaration:

Code:
Dim $var1

I can't tell you more without any code of yours.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: AutoIT Variable #3
Code:
HotKeySet("{F1}","_disconnect") HotKeySet("{F2}",'_exit') MsgBox(0, "Info", "To save the logs, Press F1 and for reconnect , start the client again." & @CRLF & "F2 = Exit") #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <File.au3> #region ### Start Koda GUI section ### Form= $Form1 = GuiCreate("KeyLogger" , 306,347,192,124) $ip_adresse = GuiCtrlCreateInput("127.0.0.1", 8,16,81,21) $button1 = GUICtrlCreateButton("Connect", 96,16,65,25, $WS_GROUP) $status = GUICtrlCreateLabel("Disconnect" , 224,16,68,17) GUICtrlSetFont(-1,8,800,0, "Myriad Pro") GUICtrlSetColor(-1, 0xFF0000) $Edit1 = GUICtrlCreateEdit("", 8,48,289,257, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $disconnect = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $disconnect = 0 TCPStartup() $Connection = TCPConnect(GUICtrlRead($ip_addresse) , 5900) If $Connection < 0 Then MsgBox(16, "Error", "Verbindung konnte nicht aufgebaut werden") _exit() Else While $disconnect = 0 GUICtrlSetData($status, "Connected") GUICtrlSetColor($status, 0x00FF00) $Resv = TCPRecv($Connection, 2) GUICtrlSetData($Edit1, $Resv, 1) if @error Then MsgBox(16, "Error", "Verbindung unterbrochen") _exit() EndIf WEnd EndIf Case $Button2 if NOT FileExists(@ScriptDir & "log.txt") Then _FileCreate("log.txt") Sleep(200) $file = FileOpen(@ScriptDir & "log.txt") Else $file = FileOpen(@ScriptDir & "log.txt") EndIf FileWrite($file, GUICtrlRead($Edit1)) Sleep(500) FileClose($file) EndSwitch WEnd Func _disconnect() $disconnect = 1 GUICtrlSetData($status, "Disconnected") GUICtrlSetColor($status, 0xFF0000) EndFunc Func _exit() TCPCloseSocket($Connection) TCPShutdown() Exit EndFunc


HERE IS THE CODE

Reply

RE: AutoIT Variable #4
Doesn't the error outputter say on which line the error is? That'd be easier. :huh:
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U

If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize

Reply

RE: AutoIT Variable #5
(06-26-2013, 09:25 PM)noize Wrote: Doesn't the error outputter say on which line the error is? That'd be easier. :huh:
It actually doesn't :| I think
[Image: 1938b62b98e32889e4ab51949cb54643217.png]

Reply

RE: AutoIT Variable #6
You see, you're saying there are two possibilities (cases), for either button1 or button2, but while you defined button1 here:

Code:
$button1 = GUICtrlCreateButton("Connect", 96,16,65,25, $WS_GROUP)

You never defined the variable $button2.
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U

If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize

Reply

RE: AutoIT Variable #7
(06-26-2013, 11:43 PM)noize Wrote: You see, you're saying there are two possibilities (cases), for either button1 or button2, but while you defined button1 here:

Code:
$button1 = GUICtrlCreateButton("Connect", 96,16,65,25, $WS_GROUP)

You never defined the variable $button2.

THANK YOU SO MUCH ! I FIXED IT !

Reply

RE: AutoIT Variable #8
(06-27-2013, 12:58 AM)Clevaro Wrote: THANK YOU SO MUCH ! I FIXED IT !

I'm glad you fixed this, and that's nice to see someone still saying something here. It looked like the AutoIt section died a long long time ago.
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U

If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize

Reply