Strings

M

Mike NG

Does anyone know if there is a large overhead in declaring a variable
length string (which could hold up to 2^31 characters) over a fixed
length string? I assume the memory gets allocated on the fly as 2^31
bytes = 2 GIG, and I only have half a gig of memory. I need to declare
some pretty huge arrays of strings and need to know up front if I am
going to run out of memory or not

I appreciate I'd have to implement my own terminator and length function
like in C. My strings will typically be 16 characters long, but could
go up to say 35 characters long
 
R

Ron Rosenfeld

Does anyone know if there is a large overhead in declaring a variable
length string (which could hold up to 2^31 characters) over a fixed
length string? I assume the memory gets allocated on the fly as 2^31
bytes = 2 GIG, and I only have half a gig of memory. I need to declare
some pretty huge arrays of strings and need to know up front if I am
going to run out of memory or not

I appreciate I'd have to implement my own terminator and length function
like in C. My strings will typically be 16 characters long, but could
go up to say 35 characters long

From the description of data types in HELP for VBA, it looks as if there is an
overhead of 10 bytes/string for variable length strings.


--ron
 
M

Mike NG

From the description of data types in HELP for VBA, it looks as if there is an
overhead of 10 bytes/string for variable length strings.
Thanks for that - I just looked at help for string and it didn't mention
the overhead
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Truncation of string problem 3
equalise text length in combo box 4
Comparing to Arrays 7
Long strings 2
Length of integer 4
Sorted Fixed Length String 8
Fast way to generate unique strings 2
Error code 91 7

Top