Big Jon
09-12-2008, 14:06
I'm currently playing around with the INI module, dynamically building the entire file and I have a problem I'm trying to solve for which I require some help.
Currently my 'ini file' works using either of the following layouts.
[DataOne]
SomeValue=SomeData
[DataTwo]
OtherValue=OtherData
[DataThree]
ExtraValue=ExtraData
[SectionName]
ValueName=DataOne
ValueName=DataTwo
ValueName=DataThree
or better still
[DataOne]
SomeValue=SomeData
[DataTwo]
OtherValue=OtherData
[DataThree]
ExtraValue=ExtraData
[SectionName]
ValueName=DataOne,DataTwo,DataThree
Okay now using INI_SetKey when I output SectionName, ValueName, DataTwo it overwrites the previous 'DataOne' entry when what I ideally want is to either append to the line with a comma delimiter or add an additional line as shown above.
Because my 'Data*' value data entries are actually names of the other sections within the ini file, I figured that the best way may be to use INI_GetSectionKeyList to list each and then build a comma delimited line writing it once again using INI_SetKey.
My problem with this method is that the INI_GetSectionKeyList is CRLF separated as opposed to commas.
Any suggestions please.
Currently my 'ini file' works using either of the following layouts.
[DataOne]
SomeValue=SomeData
[DataTwo]
OtherValue=OtherData
[DataThree]
ExtraValue=ExtraData
[SectionName]
ValueName=DataOne
ValueName=DataTwo
ValueName=DataThree
or better still
[DataOne]
SomeValue=SomeData
[DataTwo]
OtherValue=OtherData
[DataThree]
ExtraValue=ExtraData
[SectionName]
ValueName=DataOne,DataTwo,DataThree
Okay now using INI_SetKey when I output SectionName, ValueName, DataTwo it overwrites the previous 'DataOne' entry when what I ideally want is to either append to the line with a comma delimiter or add an additional line as shown above.
Because my 'Data*' value data entries are actually names of the other sections within the ini file, I figured that the best way may be to use INI_GetSectionKeyList to list each and then build a comma delimited line writing it once again using INI_SetKey.
My problem with this method is that the INI_GetSectionKeyList is CRLF separated as opposed to commas.
Any suggestions please.