Yet Another question for you experts...
I'm developing a ASCII text-based RPG game. I'm finding that I'm repeating text strings in many places. I assume each unique string takes up string memory. Would it be more efficient to create string var words such as confused$ and then assemble phrases/sentences using these string var words?
For example, I might issue the following messages: "You feel intutitive", "You feel creative", "You feel stealthy", etc.
Would it be better to define a string var phrase like this: youfeel$ = "You feel", intuitive$ = "intuitive", creative$ = "creative"
And then throught my code, piece the phrase together like this: print youfeel$ + intuitive$
Is it worth it? Will I save string memory but pay more in code memory?
Am using QB7.1 Thanks for any help!
Yet Another question for you experts...
Moderators:Administrator, Global Moderator
- frankiebaby
- Global Moderator
- Posts:95
- Joined:Tue Apr 30, 2002 1:38 am
- Location:Pennsylvania
- Contact:
Re: Yet Another question for you experts...
I really am not sure how string memory works, but ive found (by opening an EXE in notepad out of curiosity) that most of the text strings entered are readable and not just jibberish ascii data. So, i would GUESS that no, it would not be worth it. I DO NOT know for sure. USE the fre() function to show free string space and experiment. look it up in help, it may need sumthing passed in