Jump to content
IGNORED

PRINTing score


Recommended Posts

In Atari BASIC, use LEN(STR$(SCORE)) to get the size of the score. So, use something like:

POSITION 10-LEN(STR$(SCORE)),0
? SCORE;

But you must be sure that it will always increase, or you'll have to clean that space before updating, or use something like:

POSITION 0,0
? SPACE$(1,10-LEN(STR$(SCORE)));SCORE;

where SPACE$ is a string initialized with a given number of spaces, at least 9 in this example.

 

The first method should work in the latest verisions of Fastbasic, but for the second one, the method to get a substring is different from Atari Basic, and the bracket operator should be used:

POSITION 0,0
? SPACE$[LEN(STR$(SCORE))];SCORE;

But for scores higher than 9999 you probably need to use a floating point score variable SCORE%, or limit it to 4 variable digits and a fixed multiplier string (adding "0" or "00" at the end of the print).

 

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...