IniItemizePvt Limitation

Started by richardh, July 17, 2013, 03:23:32 PM

Previous topic - Next topic

richardh

This appears to have a limitation of 370 values when I test.

Is this a string limit or an item limit?

Thanks,
RH

ChuckC

At a guess, it is actually some sort of limitation imposed by the underlying Win32 API functions that all of the WIL Ini*() functions make use of for all of its functionality related to .INI files.

nrr

RH,

I just ran a quick test that creates 5000 keys in a section and used IniItemizeSection without an issue.  See code below.  What problem are you seeing?

Nick

Code (winbatch) Select

iniFile = "C:\temp\test.ini"
for i = 1 to 5000
    key   = StrCat("key", i)
value = StrCat("value", i)
    IniWritePvt("Section", key, value, iniFile)
next

lstParameters = IniItemizePvt("Section", iniFile)
keyCount = ItemCount(lstParameters, @TAB)
message("Key count", keyCount)
randomValue4999 = ItemExtract(4999, lstParameters, @TAB)
message("Random Value - 4999", randomValue4999)
exit[code=winbatch]

richardh

Did more testing, I am not hitting a list or function limitation.
Turned out that the INI was corrupted :o
Thanks for code sample Nick I modified it to test :

Code (winbatch) Select

iniFile = "C:\temp\test.ini"
count = 600
for i = 1 to count
    key   = StrCat("key", i)
        value = StrCat("value", i)
    IniWritePvt("Section", key, value, iniFile)
next

lstParameters = IniItemizePvt("Section", iniFile)
keyCount = ItemCount(lstParameters, @TAB)
message("Key count", keyCount)

array = ArrDimension (3, count)

For intI = 0 To count-1
   keyName = ItemExtract (intI + 1, lstParameters, @TAB)
   keyValue= IniReadPvt("Section", keyName, "", iniFile")
   keyCount=strcat("Section", intI+1)
   array[0,intI] = keyCount
   array[1,intI] = keyName
   array[2,intI] = keyValue

next

ArrayFilePutCSV("c:\temp\outputb.csv", array, ",",@TRUE,2)
exit[code=winbatch]