anyone good with .ini stuff?

Status
Not open for further replies.

kool26

New member
Joined
Aug 7, 2006
Messages
134
Reaction score
0
Points
0
Hello was wondering if anyone could help me with a .ini problem i got it to write to ini ect.but not comming out like i want it too lil help please.:)

This is code that iam using.

Code:
/declare itemname string local
/declare ItemSetting int local
/declare NotFound int local
/varset NotFound -1

   | Look up this item in aa.ini
   /varset ItemSetting ${Ini[aa.ini,bb,${itemname},${NotFound}]}

   /delay 5

 | If the item isn't in the .ini file then add it.

   /if (${ItemSetting}==${NotFound}) {

   /ini "aa.ini" "bb" "${itemname}"
   /ini "aa.ini" "bb" "cc"
   /ini "aa.ini" "bb" "dd"
    

    /varset ItemSetting 1

That seems to make it do this in ini

Code:
[bb]
item=
cc=
dd=
item=
item=
item=

what i would like it to do

Code:
[bb]
[item]
cc=
dd=
[item]
cc=
dd=
[item]
cc=
dd=

Ect...

Thanks for any help...:) :)
 
Last edited:
With ini's you really only get to work with 3 possibilities... Section, Key, Value
[Section]
Key=Value
Key1=Value

My suggestion to your setup would be to use:

/ini "filename.ini" "${itemname}" "cc" "blah"
/ini "filename.ini" "${itemname}" "dd" "blah blah"

This will result in:

[itemname]
cc=blah
dd=blah blah
 
Z166204 said:
With ini's you really only get to work with 3 possibilities... Section, Key, Value
[Section]
Key=Value
Key1=Value

My suggestion to your setup would be to use:

/ini "filename.ini" "${itemname}" "cc" "blah"
/ini "filename.ini" "${itemname}" "dd" "blah blah"

This will result in:

[itemname]
cc=blah
dd=blah blah

Thanks! works great now :)
 
ok, donno why i said it was working.its not writing the items not found in the .ini, to the ini.
 
If possible paste the code your attempting to use / having trouble with also along with exactly what you would like for it to do/return.
 
Status
Not open for further replies.