Beilby Posted January 24, 2009 Share Posted January 24, 2009 I would like to take the resultant string of a variable and pass this into an ,au3 file at the correct line and column. i.e. CODE$var = "world" Feeds into a script file in the same folder which could have code like this; CODE$h = "hello" $w = ;string from other script here MsgBox (0,@ScriptName, $h & " " & $w) where the text string would need to be inserted at line 7, column 6 What code would need to go into the first script if the second script was called "hello.au3" and was located in the same folder as the first running script? Link to comment Share on other sites More sharing options...
Authenticity Posted January 24, 2009 Share Posted January 24, 2009 (edited) #inculde "hello.au3" ; There is a variable named $w in the header file like "Global Const $w = 'Hello' Dim $hello $Hello = $w ;? this is what you mean?Angle bracket is for the default include folder where AutoIt search for <> includes and double quotes tells AutoIt that the file resides in the script's folder.Edit: I feel like I've missed something, if you want to send your current script string variable or anything to external script you can make some function that take either ByRef or ByVal (ByVal is the default method and there is no such keywork - ByVal). Both method, and the upper one can help you send or initialized variables from/of external scripts. Edited January 24, 2009 by Authenticity Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 25, 2009 Share Posted January 25, 2009 I would like to take the resultant string of a variable and pass this into an ,au3 file at the correct line and column. i.e. $var = "world" Feeds into a script file in the same folder which could have code like this; $h = "hello" $w =;string from other script here MsgBox (0,@ScriptName, $h & " " & $w) where the text string would need to be inserted at line 7, column 6 What code would need to go into the first script if the second script was called "hello.au3" and was located in the same folder as the first running script? Why wouldn't you just call the other script with a command line parameter containing the variable data? Anyway, if you are determined to do it that way, use FileReadLine() and _FileWriteToLine() to make the changes. 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 Link to comment Share on other sites More sharing options...
Beilby Posted January 25, 2009 Author Share Posted January 25, 2009 Why wouldn't you just call the other script with a command line parameter containing the variable data?Anyway, if you are determined to do it that way, use FileReadLine() and _FileWriteToLine() to make the changes. Indeed _FileWriteToLine() is the method I have gone for in the end, thanks for your help all 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