Author Topic: IniItemizePvt Limitation  (Read 2941 times)

richardh

  • Jr. Member
  • **
  • Posts: 54
IniItemizePvt Limitation
« on: July 17, 2013, 03:23:32 pm »
This appears to have a limitation of 370 values when I test.

Is this a string limit or an item limit?

Thanks,
RH

ChuckC

  • Full Member
  • ***
  • Posts: 247
Re: IniItemizePvt Limitation
« Reply #1 on: July 18, 2013, 05:13:50 am »
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

  • Newbie
  • *
  • Posts: 10
Re: IniItemizePvt Limitation
« Reply #2 on: July 18, 2013, 05:33:53 am »
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
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

  • Jr. Member
  • **
  • Posts: 54
Re: IniItemizePvt Limitation
« Reply #3 on: July 18, 2013, 06:35:36 am »
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
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]