Jump to content

Executing builtin functions question


Darin
 Share

Recommended Posts

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.

Link to comment
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? )

Link to comment
Share on other sites

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
Link to comment
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? :)

Link to comment
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....

:)

Link to comment
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.

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...