Modify

Opened 12 years ago

Closed 12 years ago

#518 closed Feature Request (Rejected)

IniRead() optionally create default entry if not exists

Reported by: matin@… Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: ini iniread udf Cc:

Description

For scripts that use INI files, the option to create default INI values is desired. The current IniRead() function allows passing of a default value if specified section/key pair is absent. The requested enhancement would optionally create the specified section/key (and INI file, if necessary) with the default value if it does not exist.

This allows new script versions to add new INI parameters that will be written to an existing file, and allows automatic re-creation of a default INI file if no INI file is present. (Deleting an existing INI file would result in creation of a default INI.)

This feature could be implemented in one of two ways:

1) Adding an additional parameter to the AutoIt core after the "default" value that indicates whether the default value should be written to the INI file if it does not exist:

IniRead ( "filename", "section", "key", "default", "CREATE_OPTION" )

; CREATE_OPTION = TRUE/1 to write section/key/default to ini filename if it does not exist

2) Adding an _IniReadDefault() or similarly-named function to Misc.udf (or other) that writes the section/key/default to the ini filename if it does not exist.

If the feature is viable, and option 2 is preferred, a UDF function will be submitted. (Developer recommendations for the function name would be taken.)

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by TicketCleanup

  • Version 3.2.12.0 deleted

Automatic ticket cleanup.

comment:2 Changed 12 years ago by Valik

  • Resolution set to Rejected
  • Status changed from new to closed

You're asking for a function that reads to have the ability to write? Think about that for a second.

Anyway, this doesn't sound all that useful for the masses. In general, it shouldn't make any difference whether the key exists or not. You obviously realize how trivial it is to wrap the desired functionality in a UDF so I suggest just using that for your own needs.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.