Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Most efficient way to build a big variable length string?
#1
I need to build a huge variable length string (>1GB) in memory before calling a function or writing to a file.
I already found out I can most efficiently build it up in a _MEM block.
But what is the best way to move that in the end to a variable string without copying and doubling the memory used.
So basically I am looking to a more efficient way to do:
Code: (Select All)
sql$ = Space$(mpos): _MemGet m, m.OFFSET, sql$
for very big mpos?
Is that even possible?

related to this, what is the most efficient coding to work with a big string where you have to remove a lot of pieces out without doing something like:
Code: (Select All)
sql$ = Left$(sql$, mpos - 1) + Mid$(sql$, mpos + 1)
With very big strings this is also expensive
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply


Messages In This Thread
Most efficient way to build a big variable length string? - by mdijkens - Today, 09:37 AM



Users browsing this thread: 13 Guest(s)