Jump to content
Sign in to follow this  
friends

IniWrite

Recommended Posts

friends

I wonder if IniWrite() can overwrite the content of the previously output file ?

If it couldn't, how should I make it so ?

I wanted it to be worked like FileWriteLine(), where we can have an option

to choose whether to overwrite the file.

Please advise.

TQ.

Share this post


Link to post
Share on other sites
themax90

If FileExists($Ini) <> 1 Then 
   IniWrite($Ini, "Info", "Creation", "Ini has been created!")
  ; Etc...
EndIf

Hope that solved your problem, fill it in with the appropriate values if you wish

Share this post


Link to post
Share on other sites
friends

If FileExists($Ini) <> 1 Then 
   IniWrite($Ini, "Info", "Creation", "Ini has been created!")
 ; Etc...
EndIf

Hope that solved your problem, fill it in with the appropriate values if you wish

Thanks for the reply.

May be I didn't make my question clear enough (Sorry !)

Hmm... does the IniWrite() will by default overwrite the file ?

Example, when I 1st run a program, a .INI file is created.

When I 2nd run a program, will this time .INI file overwrites the previous (1st run .INI file) ?

Thanks. I hope I make it clears :P

Share this post


Link to post
Share on other sites
MHz

When I 2nd run a program, will this time .INI file overwrites the previous (1st run .INI file) ?

Thanks. I hope I make it clears :P

IniWrite() creates the file if it does not exist. Any further use will only update the values that you choose. FileWriteLine() is much different to IniWrite() in comparison. IniWrite() is more like RegWrite() in that it changes values.

If you want to overwrite with a new ini, then you would need to FileDelete() the ini file and create it again with Iniwrite(). You normally would not do this but shows how if desired to.

Share this post


Link to post
Share on other sites
friends

IniWrite() creates the file if it does not exist. Any further use will only update the values that you choose. FileWriteLine() is much different to IniWrite() in comparison. IniWrite() is more like RegWrite() in that it changes values.

If you want to overwrite with a new ini, then you would need to FileDelete() the ini file and create it again with Iniwrite(). You normally would not do this but shows how if desired to.

Thanks, I totally got it ! :P

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  

×