Classic Computer Magazine Archive COMPUTE! ISSUE 76 / SEPTEMBER 1986 / PAGE 10

Reader's Feedback

The Editors and Readers of COMPUTE!

If you have any questions, comments, or suggestions you would like to see addressed in this column, write to "Readers' Feedback," COMPUTE!, P.O. Box 5406, Greensboro, NC 27403. Due to the volume of mail we receive, we regret that we cannot provide personal answers to technical questions.


Commodore SHIFT-SPACE

Sometimes when typing in programs from your magazine on my 64, I've come across a SHIFT-SPACE. When I press SHIFT and the space bar, it doesn't appear any different on my screen from the normal space. What does the SHIFT-SPACE character do?

Warren Frederick

There is a difference between the normal space character and shifted space. Although they appear the same on your screen, they are actually two separate ASCII characters. The normal space is CHR$(32) while the shifted space is CHR$(160). This distinction is probably not significant in every Commodore program where a {SHIFT-SPACE} appears. Many times, the programmer happens to be working in lowercase and types in an entire message with SHIFT LOCK down. When this happens, a shifted space appears in the listing, but an unshifted space would work just as well.

However, sometimes SHIFT-SPACE serves a special purpose. Certain programs use SHIFT-SPACE to mark a position on the screen that's invisible to the user. By PEEKing into screen memory, the program can distinguish between shifted and unshifted spaces even though both look identical on the screen.

You can also use SHIFT-SPACE to add short comments to disk filenames. If you include a shifted space as part of the filename, the disk drive treats that character as the end of the name and ignores any characters that come after it. But the extra characters are visible when you list the disk directory. For instance, you might want to save the current date to indicate when a program was last revised. This statement saves a program as FILE, followed by the date 9/22/86:

SAVE "FILE"+CHR$(160)+"9/22/86",8

After you execute this statement, you can still load the program normally, with LOAD "FILE",8. But when you list the directory, the filename appears as FILE/9/22/86. This trick is frequently used when saving machine language programs, to indicate the SYS address used to start the program. Of course you are limited to a total of 16 characters, just as with any other disk filename.