trini0 Posted October 5, 2008 Share Posted October 5, 2008 I'm attempting to write a script that includes files depending on the Operating system that the script is running on. I understand that I cannot use variables in an #include statement. So I tried to use a switch statement to include the files I needed, and I kept getting an error that the closing conditional statement was unavailable. Here is an example of what I'm talking about. When I attempt to run foo.au3, I get -> Error: "If" statement has no matching "EndIf" statement Could someone suggest how they handle dynamic calling of other autoit files, or how to handle including autoit files in conditional statements. Thanks ;; foo.au3 $myVar = "test" if $myVar = "test" Then #include "bar.au3" EndIf ;; bar.au3 Func bar() EndFunc Link to comment Share on other sites More sharing options...
TehWhale Posted October 5, 2008 Share Posted October 5, 2008 Hello, and welcome to the forums! You should not do this, this way. You should keep your bar function in, and then us If @OS = "WIN_XP" or whatever, then call it. When compiling the Aut2Exe puts all in includes in the script, where they are, so if you have that, when you compile it, it will put the function in that area, which is cannot be. Link to comment Share on other sites More sharing options...
trini0 Posted October 5, 2008 Author Share Posted October 5, 2008 Thanks for the advise. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now