Jump to content

Reading and writing Property files


ur
 Share

Recommended Posts

The below functions are to write data to a configuration or property file and also read them back.

BuildLocation:C:\Build
BuildExe  :   setup.exe
Release:r9.7
Silent:No
InstallPath:default
Compare :No
MartUpgrade :Yes
Bit:64
ERwinUpgrade:No
License_File:150416-1952 Navigator (ca.com).lic

You can change the character from ":" to "=" or whatever based on your requirement and update the code also accordingly.

Property.au3

Edited by ur
Link to comment
Share on other sites

  • Moderators

A couple suggestions. You have a large number of commented lines you may want to remove, if you expect this to be a "finished product" for people to use. Also, the code is almost completely redundant (only 4 lines are different). You could easily add a switch to capture whether it is a read or write operation, and make this a single function rather than two.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Logic looks fine, just erroneous and redundant as @JLogan3o13 pointed out.  His suggestion to look into consolidating into a common function (or otherwise modularize) would be my suggestion as well.  

A couple of examples:

 

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

×
×
  • Create New...