Sign in to follow this  
Followers 0
Encryption

Label Problem

15 posts in this topic

$Name = " "

$Label_7 = GUICtrlCreateLabel($Name, 170, 70)

:P

$Label_7 = GUICtrlCreateLabel($Name, 170, 70)

$Label_7 = GUICtrlCreateLabel(^ ERROR

;)

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered



$cell = ""
$cell2 = " this works"
GUICtrlCreateLabel ($cell,  10, 30) 
GUICtrlCreateLabel ($cell2,  40, 30) 
GUISetState ()   ; will display an empty dialog box

; Run the GUI until the dialog is closed
Do
    $msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

;Testing Functions
ClientInfo("EasyBot Test", "mason", "b4sketcase@gmail.com")
InitBot()

;Client Info Variables and Client Info Function
$botName = " "
$author = " "
$email = " "
Func ClientInfo($NAMEOFBOT, $CREATOR, $EMAILADDRESS)
    $botName = $NAMEOFBOT
    $author = $CREATOR
    $email = $EMAILADDRESS
EndFunc

;GUI On Start Creation with Script Info
Func InitBot()
    GuiCreate("EasyBot v1.0", 402, 181,(@DesktopWidth-402)/2, (@DesktopHeight-181)/2)
    
    $Button_Start = GuiCtrlCreateButton("Start", 80, 140, 90, 30)
    $Button_Exit = GuiCtrlCreateButton("Exit", 230, 140, 90, 30)
    $Label_1 = GuiCtrlCreateLabel("EasyBot v1.0", 165, 10, 70, 20)
    $Label_2 = GUICtrlCreateLabel("By Mason", 175, 25)
    $Label_3 = GUICtrlCreateLabel("Script Info", 175, 50)
    $Label_4 = GUICtrlCreateLabel("Bot Name:", 140, 70)
    $Label_5 = GUICtrlCreateLabel("Author:", 155, 85)
    $Label_6 = GUICtrlCreateLabel("Author's Email:", 120, 100)
    $Label_7 = GUICtrlCreateLabel($botName, 170, 70)
    
    GuiSetState()
    
    While 1
        $msg = GuiGetMsg()
        Select
            
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $Button_Exit
                Exit
            Case $msg = $Button_Start
                ExitLoop
        EndSelect
    WEnd
EndFunc

Explain whats wrong?

Share this post


Link to post
Share on other sites

#include <GUIConstants.au3>

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Its there, thats just a snippet of my code, but its the part generating the error.

Share this post


Link to post
Share on other sites

;Testing Functions
ClientInfo("EasyBot Test", "mason", "b4sketcase@gmail.com")
InitBot()

;Client Info Variables and Client Info Function
$botName = " "
$author = " "
$email = " "
Func ClientInfo($NAMEOFBOT, $CREATOR, $EMAILADDRESS)
    $botName = $NAMEOFBOT
    $author = $CREATOR
    $email = $EMAILADDRESS
EndFunc

;GUI On Start Creation with Script Info
Func InitBot()
    GuiCreate("EasyBot v1.0", 402, 181,(@DesktopWidth-402)/2, (@DesktopHeight-181)/2)
    
    $Button_Start = GuiCtrlCreateButton("Start", 80, 140, 90, 30)
    $Button_Exit = GuiCtrlCreateButton("Exit", 230, 140, 90, 30)
    $Label_1 = GuiCtrlCreateLabel("EasyBot v1.0", 165, 10, 70, 20)
    $Label_2 = GUICtrlCreateLabel("By Mason", 175, 25)
    $Label_3 = GUICtrlCreateLabel("Script Info", 175, 50)
    $Label_4 = GUICtrlCreateLabel("Bot Name:", 140, 70)
    $Label_5 = GUICtrlCreateLabel("Author:", 155, 85)
    $Label_6 = GUICtrlCreateLabel("Author's Email:", 120, 100)
    $Label_7 = GUICtrlCreateLabel($botName, 170, 70)
    
    GuiSetState()
    
    While 1
        $msg = GuiGetMsg()
        Select
            
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $Button_Exit
                Exit
            Case $msg = $Button_Start
                ExitLoop
        EndSelect
    WEnd
EndFunc

Explain whats wrong?

Func ClientInfo($NAMEOFBOT, $CREATOR, $EMAILADDRESS)
    $botName = $NAMEOFBOT
    $author = $CREATOR
    $email = $EMAILADDRESS
EndFunc

you aren't returning anything from the function (the variables are local to the function and dont escape the function unless they are Global or you use Return )


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

is there another gui

is there another $Label1

is there another While 1

*********** i hate guessing at snippets

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

This works

#include <GuiConstants.au3>
;Testing Functions
;ClientInfo("EasyBot Test", "mason", "b4sketcase@gmail.com")
InitBot()

;Client Info Variables and Client Info Function
Dim $botName = " "
Dim $author = " "
Dim $email = " "

Func ClientInfo($NAMEOFBOT, $CREATOR, $EMAILADDRESS)
    $botName = $NAMEOFBOT
    $author = $CREATOR
    $email = $EMAILADDRESS
EndFunc

;GUI On Start Creation with Script Info
Func InitBot()
    
    Dim $botName = ""
    GuiCreate("EasyBot v1.0", 402, 181,(@DesktopWidth-402)/2, (@DesktopHeight-181)/2)
    
    $Button_Start = GuiCtrlCreateButton("Start", 80, 140, 90, 30)
    $Button_Exit = GuiCtrlCreateButton("Exit", 230, 140, 90, 30)
    $Label_1 = GuiCtrlCreateLabel("EasyBot v1.0", 165, 10, 70, 20)
    $Label_2 = GUICtrlCreateLabel("By Mason", 175, 25)
    $Label_3 = GUICtrlCreateLabel("Script Info", 175, 50)
    $Label_4 = GUICtrlCreateLabel("Bot Name:", 140, 70)
    $Label_5 = GUICtrlCreateLabel("Author:", 155, 85)
    $Label_6 = GUICtrlCreateLabel("Author's Email:", 120, 100)
    $Label_7 = GUICtrlCreateLabel($botName, 170, 70)
    
    GuiSetState()
    
    While 1
        $msg = GuiGetMsg()
        Select
            
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $Button_Exit
                Exit
            Case $msg = $Button_Start
                ExitLoop
        EndSelect
    WEnd
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

$ClientInfo = ClientInfo("EasyBot Test", "mason", "b4sketcase@gmail.com")
InitBot()

Func ClientInfo($botname, $author, $email)
    Dim $Info[3]
    $Info[0] = $botname
    $Info[1] = $author
    $Info[2] = $email
    Return $Info
EndFunc

;GUI On Start Creation with Script Info
Func InitBot()
    GuiCreate("EasyBot v1.0", 402, 181,(@DesktopWidth-402)/2, (@DesktopHeight-181)/2)
    
    $Button_Start = GuiCtrlCreateButton("Start", 80, 140, 90, 30)
    $Button_Exit = GuiCtrlCreateButton("Exit", 230, 140, 90, 30)
    $Label_1 = GuiCtrlCreateLabel("EasyBot v1.0", 165, 10, 70, 20)
    $Label_2 = GUICtrlCreateLabel("By Mason", 175, 25)
    $Label_3 = GUICtrlCreateLabel("Script Info", 175, 50)
    $Label_4 = GUICtrlCreateLabel("Bot Name:", 140, 70)
    $Label_5 = GUICtrlCreateLabel("Author:", 155, 85)
    $Label_6 = GUICtrlCreateLabel("Author's Email:", 120, 100)
    $Label_7 = GUICtrlCreateLabel($ClientInfo[0], 170, 70)
    
    GuiSetState()
    
    While 1
        $msg = GuiGetMsg()
        Select
            
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $Button_Exit
                Exit
            Case $msg = $Button_Start
                ExitLoop
        EndSelect
    WEnd
EndFunc

There we are...fixed it up. Being stupid as usual...after being away from AutoIt for so long, it seems that C++ is so much more simple. ;)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

instead of this

$Label_7 = GUICtrlCreateLabel($ClientInfo[0], 170, 70)

didn't you want this

$Label_7 = GUICtrlCreateLabel($Info[0], 170, 70)

????

8)

EDIT

Maybe not

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

$ClientInfo = ClientInfo("EasyBot Test", "mason", "b4sketcase@gmail.com")
InitBot()

Func ClientInfo($botname, $author, $email)
    Dim $Info[3]
    $Info[0] = $botname
    $Info[1] = $author
    $Info[2] = $email
    Return $Info
EndFunc

;GUI On Start Creation with Script Info
Func InitBot()
    GuiCreate("EasyBot v1.0", 402, 181,(@DesktopWidth-402)/2, (@DesktopHeight-181)/2)
    
    $Button_Start = GuiCtrlCreateButton("Start", 80, 140, 90, 30)
    $Button_Exit = GuiCtrlCreateButton("Exit", 230, 140, 90, 30)
    $Label_1 = GuiCtrlCreateLabel("EasyBot v1.0", 165, 10, 70, 20)
    $Label_2 = GUICtrlCreateLabel("By Mason", 175, 25)
    $Label_3 = GUICtrlCreateLabel("Script Info", 175, 50)
    $Label_4 = GUICtrlCreateLabel("Bot Name:", 140, 70)
    $Label_5 = GUICtrlCreateLabel("Author:", 155, 85)
    $Label_6 = GUICtrlCreateLabel("Author's Email:", 120, 100)
    $Label_7 = GUICtrlCreateLabel($ClientInfo[0], 170, 70)
    
    GuiSetState()
    
    While 1
        $msg = GuiGetMsg()
        Select
            
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $Button_Exit
                Exit
            Case $msg = $Button_Start
                ExitLoop
        EndSelect
    WEnd
EndFunc

There we are...fixed it up. Being stupid as usual...after being away from AutoIt for so long, it seems that C++ is so much more simple. ;)

Are the arrays in both these lines supposed to be the same name?

Line 5 ------------------------------------------- $Info[0] = $botname
Line 23 -----  $Label_7 = GUICtrlCreateLabel($ClientInfo[0], 170, 70)

If they're not, where does $ClientInfo[0] get initialized?

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites

;)

I'm afraid you all misunderstood. My last code worked perfectly, I was just posting it to show what I had done...

I should specify next time I suppose, but it really isn't fun that way.

Share this post


Link to post
Share on other sites

maby @ the top ?

$ClientInfo = ClientInfo("EasyBot Test", "mason", "b4sketcase@gmail.com")
Yes, at the top, I must have been looking too hard. :">

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

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  
Followers 0