Page 1 of 1

Yet Another question for you experts...

Posted: Wed Dec 04, 2002 11:15 pm
by Guest
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!

Re: Yet Another question for you experts...

Posted: Thu Dec 05, 2002 3:57 am
by frankiebaby
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