Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted

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","")
Posted

_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

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
×
×
  • Create New...