That's because PB uses null terminated strings and from this quote from the MSDN you'll see that you have to parse the buffer to get all the entries.
MSDN wrote: ... The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character...
So you would have to do something like this, you may have to correct the code some as i haven't tested it yet:
Code: Select all
BufLen.l=32767
*buffer = AllocateMemory(0, BufLen) ; Better use memory buffer instead.
Length.l = GetPrivateProfileSection_("Reports", *buffer, BufLen, "sample.ini")
if Length = BufLen-2
; Section didn't fit inside buffer, better allocate more men
; and do it again, but i'm not doing that now...
elseif Length
Repeat
a$ = Peeks(*buffer)
if a$ <> ""
Debug a$
*buffer+Len(a$)+1
endif
Until a$ = ""
Endif
FreeMemory(0)
Something like that should work, as i said - you may have to tweak it yourself some if it doesn't work right away.
Enjoy
