I am working on a program which reads and converts various types of files
including packed files (with ZLIB). I used PARSECOUNT and PARSE$ to
read the unpacked buffer (for those of you unfamilliar with ZLIB, it
unpaks .zip files into a buffer in memory). This worked ok until I
came across some very large files which were painfully slow.
I reworked my parse loop until it was as tight as can be until it hit
me (DOH!) the PARSE$ must be counting from 1 to [x] every time I
request a specific record, and since these files were exceeding 15,000
records, this loop got longer and longer.
I solved my problem by using INSTR and parsing the file myself.
Now for my wish:
I wish I could parse a string into a string array:
DIM Buffer AS STRING
DIM File() AS STRING
DIM FileSize AS LONG
DIM crlf AS STRING
crlf=CHR$(13,10)
FileSize=PARSECOUNT(Buffer,crlf)
REDIM File(FileSize)
PARSE Buffer,crlf INTO FILE()
This would allow PARSE to be FAST, and we all like FAST.
------------------
Thanks,
John Kovacich
including packed files (with ZLIB). I used PARSECOUNT and PARSE$ to
read the unpacked buffer (for those of you unfamilliar with ZLIB, it
unpaks .zip files into a buffer in memory). This worked ok until I
came across some very large files which were painfully slow.
I reworked my parse loop until it was as tight as can be until it hit
me (DOH!) the PARSE$ must be counting from 1 to [x] every time I
request a specific record, and since these files were exceeding 15,000
records, this loop got longer and longer.
I solved my problem by using INSTR and parsing the file myself.
Now for my wish:
I wish I could parse a string into a string array:
DIM Buffer AS STRING
DIM File() AS STRING
DIM FileSize AS LONG
DIM crlf AS STRING
crlf=CHR$(13,10)
FileSize=PARSECOUNT(Buffer,crlf)
REDIM File(FileSize)
PARSE Buffer,crlf INTO FILE()
This would allow PARSE to be FAST, and we all like FAST.

------------------
Thanks,
John Kovacich
Comment