Jump to content
Sign in to follow this  
blizzedout

Create .INI

Recommended Posts

blizzedout

Is it possible for the script to build a .ini file if it cant find one?

Share this post


Link to post
Share on other sites
flyingboz

Is it possible for the script to build a .ini file if it cant find one?

<{POST_SNAPBACK}>

uh....

FileOpen()...

FileInstall()...

just to mention two possibilities.

if Not FileExists $ini_file then FileInstall($default_ini_file)

if not fileExists $ini_file then
    $fh = FileOpen($ini_file,$write)
    FileWriteLine($fh,"[header]")
    FileWriteLine($fh,"param=value")
   .......

Anything is possible if one reads the manual and codes accordingly.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites
blizzedout

uh....

    FileOpen()...

    FileInstall()...

just to mention two possibilities.

if Not FileExists $ini_file then FileInstall($default_ini_file)

if not fileExists $ini_file then
    $fh = FileOpen($ini_file,$write)
    FileWriteLine($fh,"[header]")
    FileWriteLine($fh,"param=value")
   .......

Anything is possible if one reads the manual and codes accordingly.

<{POST_SNAPBACK}>

thanks

Share this post


Link to post
Share on other sites
DeadMeat

You might also want to look at the following commands which all have to do with creating/manipulating ini files.

IniDelete

IniRead

IniReadSection

IniReadSectionNames

IniWrite

Share this post


Link to post
Share on other sites
Gigglestick

uh....

    FileOpen()...

    FileInstall()...

Like doing things the hard way, do we, flyingboz? :whistle:

Just kidding. :dance:


My UDFs: ExitCodes

Share this post


Link to post
Share on other sites
flyingboz

Like doing things the hard way, do we, flyingboz? :whistle:

..I fail to see what is difficult about writing out a line of text, or fileinstalling a preconfigured default ini file. Some of us had to write our UDFs from scratch before the language got to have as many functions incorporated as .NET , and bloated to a 136k compile :dance:

Here I am really kidding - I'd put up w/ 500k for what COM and DllCall have given us. All hail those who made that happen!

Seriously, for the new programmer, doing these things step by step are the best way to learn - then they'll understand what has to happen when they move to another (necessarily) less capable language. <duck and cover>


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
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
Sign in to follow this  

×