Sign in to follow this  
Followers 0
Darin

Executing builtin functions question

8 posts in this topic

I was wondering if there was any way to execute the builtin functions from a variable using Call or some other command I missed? OR, Is there is a way to run a .au3 from inside a compiled script?

Share this post


Link to post
Share on other sites



Hi and Welcome to the forums!

execute the builtin functions from a variable using Call or some other command I missed?

Call() is Call(), just use it if that is what you want. Experience says you doesn't want it though.

OR, Is there is a way to run a .au3 from inside a compiled script?

Define "inside".

When asking for help it is generally advisable to post a reproducer (short working example) so we have a chance of knowing what you're actually doing. Your description is kinda lacking details too.

Share this post


Link to post
Share on other sites

Inside:

Say I have a compiled script to do most of the support stuff for the install but I need to define a few particulars externally from an ini file.

[v1.2]
Commands=ProgramV1.2.au3

[v1.3]
Commands=ProgramV1.4.au3

ProgramV1.2.au3

WinWaitActive("Program Installer")
WinActivate ( "Program Installer" )
ControlClick ( "Program Installer", "", 1108 )  
ControlClick ( "Program Installer", "", 1111 )  
ControlClick ( "Program Installer", "", 1114 )  
ControlClick ( "Program Installer", "", 1117 )

ProgramV1.4.au3

WinWaitActive("Program Installer")
WinActivate ( "Program Installer" )
ControlClick ( "Program Installer", "", 520 )  
ControlClick ( "Program Installer", "", 520 )  
ControlClick ( "Program Installer", "", 524 )  
ControlClick ( "Program Installer", "", 527 )

and be able to execute those lines from a call or something ( #include won't do here) inside the compiled script.

(same reason I was asking about calling the functions from a variable and why would I not want to do it that way? )

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Ok, even though the example (the one in the function reference) didn't help I tried the execute function. That did what I needed. Effectively I can read in an .au3 and "execute" each line.

Thanks for the reponse AdmiralAlkex.

Edited by Darin

Share this post


Link to post
Share on other sites

Using Call() without a reason is pointless to start with, and later it could end up confusing and in tears.

Using Call() is going to end up confusing and in tears if you're not careful, so you shouldn't use that without a reason. Like here.

Either use functions (see "Func...Return...EndFunc" in helpfile") and then Call() them.

Example:

Change Ini to:

[v1.3]
Commands=_ProgramV14

And run:

$sRet = IniRead(@SomeFolder & "\SomeIni", "v1.3", "Commands", "SomeDefault")
If $sRet = "SomeDefault" Exit

Call($sRet)

Func _ProgramV14()
    WinWaitActive("Program Installer")
    WinActivate ( "Program Installer" )
    ControlClick ( "Program Installer", "", 520 )  
    ControlClick ( "Program Installer", "", 520 )  
    ControlClick ( "Program Installer", "", 524 )  
    ControlClick ( "Program Installer", "", 527 )  
EndFunc

Or if you want them external compile to a3x, and then run that. See "Running Scripts" in helpfile.

And you weren't born 1987 were you? :)

Share this post


Link to post
Share on other sites

Ok, even though the example didn't help I tried the execute function. That did what I needed. Effectively I can read in an .au3 and "execute" each line.

Thanks for the reponse AdmiralAlkex.

Ehhh right....

:)

Share this post


Link to post
Share on other sites

I'll have to give your example a try. Thanks.

(The example I referenced was the execute function in the help guide)

and No, I wasn't born in 1987. I'm old enough to have watched StarWars in the movie theatre in 1977 and already retired from my first career.

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