Modify

Opened 5 years ago

Closed 5 years ago

#3709 closed Bug (No Bug)

IniRenameSection deletes Old section instead of New section

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

Example:

$sIni = _
	'[Main]' & @CRLF & _
	'Key1 = 1' & @CRLF & _
	'Key2 = 2' & @CRLF & _
	'Key3 = 3' & @CRLF & _
	@CRLF & _
	'[Test]' & @CRLF & _
	'Key4 = 1' & @CRLF & _
	'Key5 = 2' & @CRLF & _
	'Key6 = 3' & @CRLF
	@CRLF & _
	'[Other]' & @CRLF & _
	'Key7 = 1' & @CRLF & _
	'Key8 = 2' & @CRLF & _
	'Key9 = 3' & @CRLF

$hFile = FileOpen('test.ini', 2)
FileWrite($hFile, $sIni)
FileClose($hFile)

IniRenameSection('test.ini', 'Other', 'Main', 1)

MsgBox(64, @ScriptName, FileRead('test.ini'), 0, Default)

The docs says:

flag ...
    $FC_OVERWRITE(1) = Overwrite "new section". This will erase any existing keys in "new section".

But it's erasing keys in old section, actualy it's just destroying Old section.

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by anonymous

Forget it, sorry my mistake in the ini string: 'Key6 = 3' & @CRLF missing the "& _".

comment:2 Changed 5 years ago by Melba23

  • Resolution set to No Bug
  • Status changed from new to closed

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.