Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Most efficient way to build a big variable length string?
#6
(11 hours ago)mdijkens Wrote: I did experiment with the _MEM(sql$) but the PUT #1, , LEFT$(sql, mpos) still makes a copy in memory.

The only way to print it to file without would be to print it at set sizes

FOR i = 0 to mpos -1000000 STEP 1,000,000  'write one 1MB to drive at a time
   PUT #1, , _MEMGET(m, m.offset + i, STRING * 1000000)
NEXT

'after 999 writes you've now written 999,000,000
'if your file was 999,999,999 bytes in size, just make a temp string with the 999,999 leftover bytes and write it last.  There won't be much overhead in the creation of a temp string of that size in your program.
Reply


Messages In This Thread
RE: Most efficient way to build a big variable length string? - by SMcNeill - 11 hours ago



Users browsing this thread: 8 Guest(s)