|
-
January 9th, 2013, 04:40 AM
#4
Re: ASCII Strings in Custom Resource Text File
More Details...
I Currently have a code module modStringData.bas with somewhere around 3000 strings all declared ...
Public Const atOn = "On"
Public Const atOff = "Off"
Public Const atEND = "END"
Public Const atSmallH = "h"
Public Const atSmallC = "c"
...and so on.
VB's scoping rules mean that memory for these strings is always allocated.
Over the years the application has grown to the point where even small changes to the code won't compile / run as VB reports "Out of Memory"
The above inefficient use of strings seems to me to be a prime candidate for saving memory.
I'm basically trying to only allocate memory when the string resource get loaded at point of use then free it again when it's no longer needed.
So...
If I use a "normal" VB String Table resource file does the whole string table get loaded at program start (In which case I don't actually save any memory)?
Or does each string get loaded individually when I call LoadResString() (In which case it doesn't matter whether I use UNICODE or ASCII & UNICODE is simpler) ?
I'm only considering using a custom resource & ASCII strings as a fairly desperate measure to save half the memory!
Apologies if all this is basic stuff (no pun intended) I'm a C programmer trying to maintain legacy VB code
Many thanks & regards
Kevin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|