MemFile System
#15
(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.
Reply


Messages In This Thread
MemFile System - by SMcNeill - 08-22-2022, 03:08 PM
RE: MemFile System - by SpriggsySpriggs - 08-22-2022, 03:16 PM
RE: MemFile System - by SMcNeill - 08-22-2022, 03:20 PM
RE: MemFile System - by SpriggsySpriggs - 08-22-2022, 03:29 PM
RE: MemFile System - by SMcNeill - 08-22-2022, 03:34 PM
RE: MemFile System - by SMcNeill - 08-22-2022, 04:07 PM
RE: MemFile System - by SMcNeill - 08-23-2022, 01:16 PM
RE: MemFile System INPUT output - by JRace - 08-23-2022, 10:56 PM
RE: MemFile System - by PhilOfPerth - 08-27-2022, 05:25 AM
RE: MemFile System - by PhilOfPerth - 08-27-2022, 06:22 AM
RE: MemFile System - by SMcNeill - 08-27-2022, 06:37 AM
RE: MemFile System - by PhilOfPerth - 08-27-2022, 08:02 AM
RE: MemFile System - by SpriggsySpriggs - 08-31-2022, 02:14 PM
RE: MemFile System - by SMcNeill - 08-31-2022, 03:01 PM
RE: MemFile System - by RhoSigma - 08-31-2022, 05:20 PM



Users browsing this thread: 5 Guest(s)