Modify

#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 by anonymous, on Apr 2, 2019 at 10:13:06 PM

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

comment:2 by Melba23, on Apr 3, 2019 at 4:26:11 PM

Resolution: No Bug
Status: newclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.