bouzzi Posted October 22, 2004 Posted October 22, 2004 We have built a little script that installs requested network printers with full configuration... Have an autoIt able to create an autoIt file for each printer: ex.: PRNT_LEX-T632-0100A.au3 Those files are use in an other autoIt for complete installation... This AutoIt is the main program in witch I need to find a way to include those printer files... ex.: - - - - - - - - - - - - - - - - - (...) Dim $IprinterNDPS[2] Dim $FicInf[2] Dim $FicInfNmImp[2] $i = 1 Pro = ProFicDat $Dest = "Pro" #include "PRNT_LEX-T632-0100A.au3" #include "_Make1Dat.au3" -+-+-+-+-+-+-+-+- How could I replace "PRNT_LEX-T632-0100A" by a variable? I have try a lot but did not find the way... Can you help me..... ? PLZ _______________________________________[font="Arial"] Bouzzi[/font]Bouzzi@yahoo.comLive From Quebec
CyberSlug Posted October 22, 2004 Posted October 22, 2004 When an AutoIt script is run, one of the very first things is that the #include statements are replaced with the corresponding code. This is before AutoIt looks up any variables..... What you might be able to do is put the #include inside an IF or SELECT CASE block. This has no benefit performance-wise, but it makes code organization better. Select Case $var = "one" #include <PRNT_LEX-T632-0100A.au3> Case $var = "two" #include <ANOTHER.au3> Case $var = "whatever" #include <And_so_on.au3> End Select Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
this-is-me Posted October 22, 2004 Posted October 22, 2004 How would that even be possible if the script were compiled? Who else would I be?
Josbe Posted October 22, 2004 Posted October 22, 2004 When an AutoIt script is run, one of the very first things is that the #include statements are replaced with the corresponding code. This is before AutoIt looks up any variables.....What you might be able to do is put the #include inside an IF or SELECT CASE block. This has no benefit performance-wise, but it makes code organization better.Select Case $var = "one" #include <PRNT_LEX-T632-0100A.au3> Case $var = "two" #include <ANOTHER.au3> Case $var = "whatever" #include <And_so_on.au3> End Select<{POST_SNAPBACK}>A line '#include' within a loop? This could show an error, if the included file contains some loop too. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Valik Posted October 22, 2004 Posted October 22, 2004 How would that even be possible if the script were compiled?<{POST_SNAPBACK}>It wouldn't, obviously. There's no parsing engine in the compiler, so how would the variable be resolved?
CyberSlug Posted October 22, 2004 Posted October 22, 2004 (edited) A line '#include' within a loop? This could show an error, if the included file contains some loop too. <{POST_SNAPBACK}>Just make sure two files do not "include" each other I'd put #include-once at the top of each file just in case....But you can #include the same file all you want, of course. Edited October 22, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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