Sign in to follow this  
Followers 0
erikson

Gui question

2 posts in this topic

hello codemasters.

i have a little problem with a script

i have:

a gui wit multiple choose

a function run_selected

a function run_selected1

a fucntion ftp_connect

my script is like this

Case $Button1

run_selected()

Case $Button2

.....................

Func run_selected()

If BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED Then run_selected1 ()

..............

Func run_selected1 ()

................................

Func ftp_connect ()

.......................

........................

EndFunc ftp_connect ()

.....................

EndFunc run_sellected1()

it is correct the script?

i mean " function in function" syntax

Share this post


Link to post
Share on other sites



If your pseudo script is actually how you have your secret information set up, then the answer is no... It isn't correct. But of course you already knew that or found that out because you tried to run it and it failed.

So to answer you next question since I told you it was wrong. You can not have functions within functions or within loops or conditional statements or anything other than by itself:

While 1
    Switch GUIGetMsg()
        Case $button
            _FunctionCall()
    EndSwitch
WEnd

Func _FunctionCall()
    ;Do Something
EndFunc
See how my call to my function is in my Case statement ... But my function is by itself.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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