Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Huge array of variable length strings
#1
For a project I need to store an array of variable length strings.
Let's say
Code: (Select All)
Dim Shared as String s(100000)
But the issue is that the string lengths could vary from several bytes up to 2 GB
Code: (Select All)
For i% = 1 To 100
  s(i%) = String$(100000000, 42) ' 100MB
Next i%
As soon as the arrays total size is above a couple of GB it aborts the program...

I'd like to find a way to make max use of internal memory (>=32GB) 
What would be the best approach to define this?
I think _Mem is not very suitable for variable length strings

I could do one big _Mem and keep track of indexes/blocks but that's complicating the code quite a bit
Any better suggestions?
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply


Messages In This Thread
Huge array of variable length strings - by mdijkens - 10-17-2024, 11:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Strings - Numbers Kernelpanic 0 113 01-20-2026, 10:29 PM
Last Post: Kernelpanic
  Array out of passing arrays... Pete 2 405 09-22-2025, 08:53 PM
Last Post: ahenry3068
  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
  Most efficient way to build a big variable length string? mdijkens 9 1,865 01-17-2025, 11:36 PM
Last Post: ahenry3068

Forum Jump:


Users browsing this thread: 1 Guest(s)