Yet Another question for you experts...

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Guest
Yet Another question for you experts...

Post by Guest » Wed Dec 04, 2002 11:15 pm

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!

User avatar
frankiebaby
Global Moderator
Posts:95
Joined:Tue Apr 30, 2002 1:38 am
Location:Pennsylvania
Contact:

Re: Yet Another question for you experts...

Post by frankiebaby » Thu Dec 05, 2002 3:57 am

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

Post Reply