Sign in to follow this  
Followers 0
Manu

Dynamic Includes

5 posts in this topic

hi all

i need help execute includes with dynamic names, because i need that people make plugins in autoit native language

for example:

main.au3

For $i = 1 To 20 Step 1

    Execute("#include <" & $i & ".au3>")
    
    Execute("test($a, $b, $c)")

Next

includes: 1.au3, 2.au3.....

Func test($a, $b, $c)
    
    MsgBox(0,"", $a + $b + $c)
    
EndFunc

i try to execute with Execute command, but only execute 1 line... >_<

i need make plugins...

:)

Share this post


Link to post
Share on other sites



hi all

i need help execute includes with dynamic names, because i need that people make plugins in autoit native language

for example:

main.au3

For $i = 1 To 20 Step 1

    Execute("#include <" & $i & ".au3>")
    
    Execute("test($a, $b, $c)")

Next

includes: 1.au3, 2.au3.....

Func test($a, $b, $c)
    
    MsgBox(0,"", $a + $b + $c)
    
EndFunc

i try to execute with Execute command, but only execute 1 line... >_<

i need make plugins...

:)

Not sure you can do it that way...

The only way I know if is the way we did it in Nerd Olympics(Siggy). Was Monoceres's idea and it seems to work great.

Hope that helps,

Szh

Share this post


Link to post
Share on other sites

When will people realize that dynamic includes will not work?

Execute also can't execute the statement #include as far as I know.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

how i can make plugins in this case ?

i can make this in php, but in autoit not :)

great all

Edited by Manu

Share this post


Link to post
Share on other sites

how i can make plugins in this case ?

great all

Depends on exactly what you mean by "plugins".

Here's one way.

As far as straight AutoIt code is concerned, the code from an include file can be conditionally executed, so you can include something and then have it never run based on run-time circumstances. But the decision to run it or not has to be at run-time, and the decision to include it in the script in case it's needed had to be made at compile-time.

:)


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

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