Modify

Opened 13 years ago

Closed 13 years ago

#2087 closed Bug (No Bug)

IniWrite & IniReadSection bug

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

Description

IniWrite -> "When writing a value that is quoted, the quotes are stripped."

--

IniWrite("test.ini", "Section", "Key", '"quoted text"')
$test = IniReadSection("test.ini", "Section")
ConsoleWrite($test[1][1] & @CRLF)

--

"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Anonymous\Desktop\test.au3"

"quoted text"

Exit code: 0 Time: 0.220

Attachments (0)

Change History (3)

comment:1 Changed 13 years ago by anonymous

Help-file says that if you read quoted text from ini file - quotes go away because they are simply used for values containing whitespaces. But when reading section with quoted values - you get quote signs. Help file doesn't say a word about that.
I don't think that it's help-file bug, rather it's the IniReadSection bug.

comment:2 Changed 13 years ago by BrewManNH

Actually the help file says: When writing a value that is quoted, the quotes are stripped. In order to write the quote marks to the value, you must double up the quoting. For example: ""This is a test"" will produce "This is a test" in the file. (this is from IniWrite in the help file)

The help file says nothing about reading values with quotes, just writing them. So, it does strip the quotes, but if they're doubled, the quotes are included in the information written.

comment:3 Changed 13 years ago by trancexx

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

String literal in AutoIt is defined as zero or more characters enclosed in quotes (single or double).
I'm sure that anyone who wrote explanation for Ini functions meant it to be understandable for absolute beginners. Probably that's why it's bit confusing. Maybe some English speaking person can write description for more advanced members or maybe they shouldn't be needing it. It's a dilemma.
Either way, no bug.

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.