08-31-2022, 05:20 PM
(08-31-2022, 02:14 PM)Spriggsy Wrote: Something I just noticed with this is that if you are assuming that the line endings are CHR$(13) + CHR$(10) ("\r\n") then that might not work with a file that has UNIX line endings, which I think is just CHR$(10) ("\n"). You might want to split on just CHR$(10) and then check for CHR$(13) existing after the split. If it does, you can just delete those. A foolproof way that I split a file up is by using my tokenize function, which uses strtok. It takes a list of characters to split on and it works just fine regardless of the file having UNIX or Windows line endings.
If you are in need for a more comprehensive system, then take this one:
https://staging.qb64phoenix.com/showthread.php?tid=486
It's basically the same thing but build on a string array rather then _MEM.
GuiTools, Blankers & other Projects:
https://staging.qb64phoenix.com/forumdisplay.php?fid=32
Libraries & useful Functions:
https://staging.qb64phoenix.com/forumdisplay.php?fid=23
https://staging.qb64phoenix.com/forumdisplay.php?fid=32
Libraries & useful Functions:
https://staging.qb64phoenix.com/forumdisplay.php?fid=23