Jump to content

Array size


Recommended Posts

umm...

Split up the file into seperate sections, 2 sections of 200 should do. I you don't want to do that then...

Write your own function! Shouldn't be too hard:

For $i = 1 to FileGetLines ($sIni)
If StringLeft (FileReadLine ($i), 1) = "[" Then; is key
    $Start = $i
    ExitLoop
EndIf
Next
If $Start = "" Then Return SetError (1, 0, 0)
For $i = $Start + 1 To FileGetLines ($sIni)
If StringLeft (FileReadLine ($i), 1) = "[" Then; is key
    $End = $i
    ExitLoop
EndIf
Next
If $End = "" Then $End =  FileGetLines ($sIni)
For $i = $Start + 1 To $End - 1
$Line = Filereadline ($i)
$Split = StringSplit ($line, "=")
If $Split[0] <> 2 then Return SetError (1, 0, 0)
;;;;
Next

basic code, and untested, but you get the idea.

Edited by mdiesel
Link to comment
Share on other sites

umm...

Split up the file into seperate sections, 2 sections of 200 should do. I you don't want to do that then...

Write your own function! Shouldn't be too hard:

For $i = 1 to FileGetLines ($sIni)
If StringLeft (FileReadLine ($i), 1) = "[" Then; is key
    $Start = $i
    ExitLoop
EndIf
Next
For $i = $Start + 1 To FileGetLines ($sIni)
If StringLeft (FileReadLine ($i), 1) = "[" Then; is key
    $End = $i
    ExitLoop
EndIf
Next
For $i = $Start + 1 To $End - 1
$Line = Filereadline ($i)
$Split = StringSplit ($line, "=")
If $Split[0] <> 2 then Return SetError (1, 0, 0)
;;;;
Next

basic code, and untested, but you get the idea.

So it's 32767 chars per section ? Or per file ?
Link to comment
Share on other sites

So it's 32767 chars per section ? Or per file ?

I don't know, I just happened to be doing this today (messing around with ini's) and I saw the limit. When you posted, I replied with an answer. I am presuming its section though, try it, if it works then it works! There you go then!

@Rich

Do you have a link to the page where it gives the commands? I can only find stuff on fmapi's, which is not right.

MDiesel

Edited by mdiesel
Link to comment
Share on other sites

http://msdn.microsoft.com/en-us/library/ms724353(VS.85).aspx

This function, GetPrivateProfileString, is probably it. I assume that since it hasn't been rewritten to avoid this limit, that it still uses this.

It doesn't say anything about the limit other than saying that it was kept for 16 bit app compatibility. 16 bit addresses could only address 65535 locations, and half of that minus one is 32767 (two's compliment). That's my guess..?

Edited by Richard Robertson
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...