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 - 01-17-2025, 09:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Variable length type declarations dano 5 681 08-06-2025, 09:53 PM
Last Post: dano
  Determining if variable or static string is passed to a Sub dano 9 1,206 06-20-2025, 06:31 PM
Last Post: CookieOscar
  Big problem for me. MystikShadows 11 1,934 01-16-2025, 05:11 AM
Last Post: JRace
  Huge array of variable length strings mdijkens 9 1,814 10-17-2024, 02:01 PM
Last Post: mdijkens
  REDIM, TYPE, and STRING Woes TerryRitchie 16 3,125 04-13-2023, 05:17 AM
Last Post: DSMan195276

Forum Jump:


Users browsing this thread: 1 Guest(s)