Sign in to follow this  
Followers 0
GaryFrost

Bug? with IniRenameSection

5 posts in this topic

Here's the scenario:

if the section is empty and I want to rename the section, but make sure not overwritting another section

I use the 0 flag

example of the ini that is failing

[MySection]

simple and should not fail.

but the following does

$res = IniRenameSection(@ScriptDir & "\My.ini", "MySection", "MyNewSection",0)
ConsoleWrite($res & ", " & @error & @LF)

now if i make the ini

[MyNewSection]
key=1

the above rename works., shouldn't fail if the section is empty (just the section header)

Agree?????

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites



The documentation may need updated. The function will only work with a non-empty source section.

An empty section is equivalent to a section that does not exist. So essentially you're saying "copy this section that doesn't exist".

Share this post


Link to post
Share on other sites

The documentation may need updated. The function will only work with a non-empty source section.

An empty section is equivalent to a section that does not exist. So essentially you're saying "copy this section that doesn't exist".

Thanks for clarifying, figured it should be as you say, but wanted to make sure.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thanks for clarifying, figured it should be as you say, but wanted to make sure.

Gary

i'm sorry for bumping the old post.

Never thought autoit HELP would have error like this.

Because I spent hours figuring out why IniRenameSection doesn't replace/renew my new section because I have my all sections without key in it.

Thank god i found this topic.

Share this post


Link to post
Share on other sites

i'm sorry for bumping the old post.

Never thought autoit HELP would have error like this.

Because I spent hours figuring out why IniRenameSection doesn't replace/renew my new section because I have my all sections without key in it.

Thank god i found this topic.

As Gary said, the documentation may need updating, and I agree tha it should be pointed out in the help that an empty section cannot be renamed, so I suggest you report it as a documentation bug/change request.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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  
Followers 0