Jump to content
Sign in to follow this  
jrkpote

Variable used without being declared

Recommended Posts

jrkpote

When i run this code:

#include <GUIConstants.au3>
#include <Process.au3>
#include <INet.au3>
#include <IE.au3>
#NoTrayIcon

Global $URL = "http://localhost:8080/loader/"

$logo = _INetGetSource($URL & "logo.jpg")
INetGet($URL & "logo.jpg", @TempDir & "\logo.jpg", 1)
$config = @TempDir & "\temp.ini"
INetGet($URL & "config.ini",$config,1)
$title = IniRead($config, "Main", "Title", "Aragor WoW Launcher")
$logo = IniRead($config, "Main", "Logo", "")
$news = IniRead($config, "Main", "News", "")
$server_eses = IniRead($config, "Main", "esES", "")
$server_engb = IniRead($config, "Main", "enGB", "")
$server_enus = IniRead($config, "Main", "enUS", "")
$wowdir = ".\"
$eu_realmlist = IniRead($config, "Main", "Realmlist", "")
$bgcolor = IniRead($config, "Main", "BgColor", "0xFFFFFF")
$gui = GUICreate($title, 410, 310)
$news = _INetGetSource($URL & "news.txt")
INetGet($URL & "news.txt", @TempDir & "\news.txt", 1)
$servidor_eses = GUICtrlCreateButton($server_eses, 45, 280, 100)
$servidor_engb = GUICtrlCreateButton($server_engb, 150, 280, 100)
$servidor_enus = GUICtrlCreateButton($server_enus, 255, 280, 100)
$logodisp = GUICtrlCreatePic(@TempDir & "\logo.jpg", 5, 5, 400, 100) 
$news=StringReplace($news,@LF,@CRLF)
$newsdisp = GUICtrlCreateEdit($news, 5, 105, 400, 170, $ES_READONLY+$WS_VSCROLL)
GUISetBkColor($bgcolor)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $server_eses
        $rc = _RunDos("rmdir /S /Q cache")
        DirRemove(".\cache")
        FileDelete($wowdir & "realmlist.wtf")
        FileWrite($wowdir & "realmlist.wtf", $eu_realmlist)
        Run($wowdir & "wow.exe")
        ExitLoop
    Case $msg = $server_engb
        $rc = _RunDos("rmdir /S /Q cache")
        DirRemove(".\cache")
        FileDelete($wowdir & "realmlist.wtf")
        FileWrite($wowdir & "realmlist.wtf", $eu_realmlist)
        Run($wowdir & "wow.exe")
        ExitLoop
    Case $msg = $server_enus
        $rc = _RunDos("rmdir /S /Q cache")
        DirRemove(".\cache")
        FileDelete($wowdir & "realmlist.wtf")
        FileWrite($wowdir & "realmlist.wtf", $eu_realmlist)
        Run($wowdir & "wow.exe")
        ExitLoop
    EndSelect
WEnd

it get this error:

Line 30 (File "E:\copy\loader\WoWLauncher.au3"):

$newdisp = GUICtrlCreateEdit($news, 5, 105, 400, 170, $ES_READONLY+$WS_VSCROLL)

$newdisp = GUICtrlCreateEdit($news, 5, 105, 400, 170 ^ERROR

Error: Variable used without being declared

some solution please?

Share this post


Link to post
Share on other sites
DaRam

You need to include EditConstants.au3

Share this post


Link to post
Share on other sites
jrkpote

i need some include more, now get this error:

Line 30 (File "E:\copy\loader\WoWLauncher.au3"):

$newdisp = GUICtrlCreateEdit($news, 5, 105, 400, 170, $ES_READONLY+$WS_VSCROLL)

$newdisp = GUICtrlCreateEdit($news, 5, 105, 400, 170 $ES_READONLY+^ERROR

Error: Variable used without being declared

Share this post


Link to post
Share on other sites
DaRam

WindowsConstants.au3

i need some include more, now get this error:

Share this post


Link to post
Share on other sites
lilx

When you look in to help and you look into the “GUI Control Styles Appendix”, you see on each new column it uses a other include. So when used a variable from a column look if you added the include that can be find on the first row of that column :D

Edited by lilx

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.