Jump to content

Pulling Varibles From A Text File


Recommended Posts

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

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

_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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...