Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Help with TEXT command

Author
Message
Celtic Mage
19
Years of Service
User Offline
Joined: 30th May 2005
Location: Hyrule
Posted: 17th Jul 2005 00:52
Okay, here's my problem. I am trying to print both a variable and text at a specific coordinate. The problem is that I cannot print both in the way that you can with the traditional BASIC language. Is there a way to do this in DB?

Thanks
Dangerous
19
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Toledo, OH
Posted: 17th Jul 2005 12:41
I am assuming you are trying to print an integer variable along with text using the text command. Here is how to do that.

ScoreText$ = "Score: " + str$(MyScore)
TEXT X,Y,ScoreText$

of course you will have to initialize the X and Y variable with the specific location to print or else replace them with the constant value. The str$() function turns an integer value into text so if your score is 1230, it is converted to the text representation of "1230". You could even accomplish this task with just a single line such as:

TEXT X,Y,"Score: " + str$(MyScore)

Its up to you to decide, but go with what feels more intuitive.

If I am crazy, and the world is crazy, then I am normal.

Login to post a reply

Server time is: 2024-11-27 22:50:41
Your offset time is: 2024-11-27 22:50:41