Modify ↓
Opened on Apr 2, 2019 at 9:21:38 PM
Closed on Apr 3, 2019 at 4:26:11 PM
#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:2 by , on Apr 3, 2019 at 4:26:11 PM
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

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