Sign in to follow this  
Followers 0
NikLok

Delemiter symbol in IniRead

9 posts in this topic

May be make feature to set delemiter symbol in IniRead construction?

And i often read and save value from/to ini file in format:

<NameValue>="Value"

May be make iniread and iniwrite support format string ?!

Share this post


Link to post
Share on other sites



May be make feature to set delemiter symbol in IniRead construction?

And i often read and save value from/to ini file in format:

<NameValue>="Value"

May be make iniread and iniwrite support format string ?!

What is simpler that ini format?

[section]

key1=value

key2=value

XML:

<section>

<key1>value</key1>

<key2>value</key2>

</section>

-or-

<section key1="value" key2="value"/>

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

May be make feature to set delemiter symbol in IniRead construction?

And i often read and save value from/to ini file in format:

<NameValue>="Value"

May be make iniread and iniwrite support format string ?!

Already been done, it's called an XML file: <NameValue="Value"/>

:)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

<NameValue="Value"/>

Make sure your / is on the right end. :)

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

<NameValue="Value"/>

Make sure your / is on the right end. :P

It is... I don't know what you mean...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

For example ini file:

; +++++++++++++++++++++++++++++++++++++++++

; BS Post Installer answers file V2.0

; this text auto generated

; Do not modify manually!!!

; +++++++++++++++++++++++++++++++++++++++++

[Common_Info]

Ver=2.0

Autor=LNM 2008

Date=16.06.2008

CRC=1420609834

[selected_Items]

installitem_618

installitem_615

installitem_600

installitem_590

installitem_360

installitem_820

installitem_800

installitem_380

installitem_290

installitem_040

installitem_410

installitem_300

installitem_278

installitem_277

installitem_276

installitem_270

installitem_260

installitem_780

installitem_058

installitem_034

installitem_030

I want get all number of installitem, but i don't want make big script with regular expression and so on!

Share this post


Link to post
Share on other sites

Well the problem here is that none of those keys have values.

This script would work but no values = no go.

$file = "test.ini"
$array = IniReadSection($file,"Selected_Items")
If NOT @ERROR Then
    For $X = 1 to $array[0][0]
        ConsoleWrite($array[$X][0] & " = " & $array[$X][1] & @CRLF)
    Next
Else
    ConsoleWrite("ERROR" & @CRLF)
EndIf

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thanks! Writing without value will be without symbol '=' or not ?

Need that without him!!!

Edited by NikLok

Share this post


Link to post
Share on other sites

Thanks! Writing without value will be without symbol '=' or not ?

Need that without him!!!

Then you're not creating an Ini file, you're doing some other monstrosity that would involve you writing your own methods of string manipulation.

Just write the "=" after the insert, and leave the value blank.

IniReadSection will then give you the keys that you can siphon through.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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