schnikies79 Posted April 24, 2006 Share Posted April 24, 2006 I have searched the forum and have been though the help files but have not come across what I'm looking for. I have 13 varibles that need to be edited by the user in a file apart from the script so they don't have to edit the script itself. Basically it's a configuration file, but each one will show up as a varible in the script. Is it possible to do this without having to open up the text file and copy/paste, compare and such? Just needing someone to point me in the right direction. Link to comment Share on other sites More sharing options...
Paulie Posted April 24, 2006 Share Posted April 24, 2006 Please post script and people may be able help you more Link to comment Share on other sites More sharing options...
elgabionline Posted April 24, 2006 Share Posted April 24, 2006 I have searched the forum and have been though the help files but have not come across what I'm looking for. I have 13 varibles that need to be edited by the user in a file apart from the script so they don't have to edit the script itself. Basically it's a configuration file, but each one will show up as a varible in the script. Is it possible to do this without having to open up the text file and copy/paste, compare and such? Just needing someone to point me in the right direction.You seem to look for something as writing in a file INI. IniRead () and IniWrite can be useful at your purposes. Link to comment Share on other sites More sharing options...
schnikies79 Posted April 24, 2006 Author Share Posted April 24, 2006 My script at the moment does nothing but cut and paste a few things then execute a batch file, which does all the work. No need to post on here yet. Just looking for direction. Trying to learn! Thanks for the info elgabionline. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 24, 2006 Share Posted April 24, 2006 something like this #include <File.au3> _filecreate(@ScriptDir & "\config.ini") $file = @ScriptDir & "\config.ini" $variable = "thatsgreat2345" FileWriteLine($file,"[config]") Filewriteline($file,"Username=" & $variable) $Username = Iniread($file,"config","Username","") Link to comment Share on other sites More sharing options...
neogia Posted April 25, 2006 Share Posted April 25, 2006 _filecreate(@ScriptDir & "\config.ini") $file = @ScriptDir & "\config.ini" $variable = "thatsgreat2345" FileWriteLine($file,"[config]") Filewriteline($file,"Username=" & $variable) Why do this extra work here, when the built in function, IniWrite() can handle all that for you? IniWrite(@ScriptDir & "\config.ini", "config", "Username", "thatsgreat2345") [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia 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