Jump to content

Whats wrong with this...


evilelf
 Share

Recommended Posts

I cant seem to get the GUI to

show my Total Runs/Run_Count.

$Label1 = GUICtrlCreateLabel("Total Runs:", 24, 112, 80, 17)
Func _TotalRuns()
$TotalRuns = $Runden; $i
        GUICtrlSetData($Label1,"Total Runs:",$TotalRuns)
    EndFunc
Func start()
For $i = $Runden to 0 step -1
    Call("TotalRuns")
    Call("Click")
Next
EndFunc
Link to comment
Share on other sites

I cant seem to get the GUI to

show my Total Runs/Run_Count.

$Label1 = GUICtrlCreateLabel("Total Runs:", 24, 112, 80, 17)
Func _TotalRuns()
$TotalRuns = $Runden; $i
        GUICtrlSetData($Label1,"Total Runs:",$TotalRuns)
    EndFunc
Func start()
For $i = $Runden to 0 step -1
    Call("TotalRuns")
    Call("Click")
Next
EndFunc
you don't appear to be call the start function...which means nothings running. try Call("start") at the beginning.
Link to comment
Share on other sites

change this

GUICtrlSetData($Label1,"Total Runs:",$TotalRuns)

to this.

GUICtrlSetData($Label1, "Total Runs: " & $TotalRuns)

not sure just thought that wasnt right, the 3rd param specifies a default value u can use in a combobox or some.

Its still not working...

Its now showing up in my GUI...

Link to comment
Share on other sites

Its still not working...

Its now showing up in my GUI...

You didn't show us any of your GUI or how you were calling the function you did show, and Robjong was right that you had the parameters wrong.

It works fine like this:

#include <GuiConstantsEx.au3>

Global $TotalRuns = 0
Global $hGUI = GUICreate("Test", 300, 200)
Global $Label1 = GUICtrlCreateLabel("Total Runs: 0", 20, 20, 260, 20)
Global $Button1 = GUICtrlCreateButton("RUN", 100, 150, 100, 30)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $TotalRuns += 1
            GUICtrlSetData($Label1,"Total Runs: " & $TotalRuns)
    EndSwitch
WEnd

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...