home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TCE Demo 2
/
TCE_DEMO_CD2.iso
/
demo_cd_.2
/
mags
/
stosser
/
stoser01.arj
/
stoser01.msa
/
A
/
A2.DOC
< prev
next >
Wrap
Text File
|
1987-04-22
|
9KB
|
296 lines
STOSSER ISSUE ONE
Lesson One, 22\03\93 By Tony Greenwood
First, I must explain that in these lessons I am presuming you are a complete
beginner, a novice. I will presume you know how to boot up your STOS Disk - and
that is that!
I will be explaining the various commands in the simplest way that is humanly
possible. I will not be copying pages from the manual to this file. The STOS
manual presumes a working knowledge of BASIC, I DON'T.
In these files I WILL give the absolute beginner a working knowledge of STOS
BASIC.
If you are lucky enough to own a printer then you will need to print this
document out. It is in the A folder entitled A2.DOC.
If, like me, you don't own a printer then I'm afraid you are going to have to
get yourself a pen and paper and copy the whole thing down by hand, unless you
have a friend with one?
You will find it impossible to try and remember what you have read, then boot
up STOS and try to implement it.
Sorry about that, but if you are really interested in learning then you WILL
find the effort worth while.
****************************************
Right, you have copied this file and you are now sat facing the booted up
STOS disk (it is a back-up isn't it?)
I want you to totally ignore the menu bar at the top of the screen, we won't
be needing it today.
There are two types of command you can give STOS. The first is a direct
command, this is when you tell STOS to do something and you don't use a line
number. The computer will carry out any such command then stop. The command you
typed in will be lost forever, so if you want it to repeat the command you
would have to type it again.
Now the screen you are looking at (if you haven't touched anything) should
have some writing on it. The CLS command clears the screen.
Now type:
CLS
Nothing should have happened. The computer will do nothing unless you press
the RETURN key - this tells the computer that you have finished and you want it
to do as you have commanded, so now press RETURN (or ENTER).
You should now have a clear screen except for the "ok" bit in the corner,
that's the computer telling you that it's done what you wanted and there's no
problem - very helpful of it!
Now type:
LIST
Then press RETURN.
Nothing happened? Well that's alright - you see, the LIST command tells it to
list all your instructions.
Try typing:
10 CLS
Then press RETURN.
Nothing happened? Don't worry - that's alright. If the command has a number
before it (a line number) then this is not a direct command and the computer
will not do it until you tell it to and we do this with a direct command.
Now type:
RUN
Then press ENTER.
Lo and behold ... the screen is cleared. Yes?
Now type:
LIST
Then press RETURN.
The "10 CLS" that you typed before should reappear. Yes?
Now type:
RUN
Then press ENTER.
As you can see, the screen has cleared again and if you type LIST the command
will reappear - good eh!
As stupid as it may sound, you have just made your first program, a screen
clearing program, but most importantly, we have covered three commands:
CLS, LIST and RUN.
IF YOU ARE NOT TOTALLY HAPPY WITH WHAT WE HAVE COVERED UP TO NOW THEN GO BACK
TO THE START AND RE-DO IT ALL UNTIL YOU FULLY UNDERSTAND WHAT IT MEANS. DO NOT
CONTINUE UNTIL YOU CAN UNDERSTAND THE DIFFERENCE BETWEEN A DIRECT COMMAND AND A
LINE COMMAND. I WON'T TELL IF YOU HAVE TO GO BACK TO THE START !!!!
**********************************************
You're back then! Very good, we will now attempt to print something onto the
screen, but first we will need to know a couple of things ...
STRING ... well a string is not a command but a name for a letter, word or
sentence that is to be printed to the screen. A string always begins with " and
also ends with a ", so TONY is not a string but "TONY" is.
To print something onto the screen we simply tell the computer to PRINT, but
the computer will only print a string starting with " and ending with ". We are
going to try it out now but first we want a clear screen to do it on.
So now type:
10 CLS
Then press ENTER.
The cursor will drop down a line and you type:
20 PRINT "TONY"
Then press ENTER.
Notice the different numbers, that's because when we tell the computer to RUN
it will look for the first line number - do as it's told on the first line
number - then it will look for the next line number - do whatever you have told
it - then search for the next - and do each line in turn, until there are no
lines left - then it will stop and tell you everythings ok.
Now give the computer a direct command (without a line number):
RUN
Well, did the screen clear? Did it print the word "TONY"?
You will notice it didn't print the " that we used before and after the word.
We are doing well aren't we!
Now type:
LIST
Then press ENTER.
That's the last time I tell you to press ENTER. You should now know when to
press it.
Keeping lines 10 and 20 type:
30 CLS
Now run it and as you can see, nothing. That's because in less than a flash
it's cleared the screen, printed TONY and cleared the screen again. Pointless I
know, but it should clear things up regarding the CLS command. Clear things up,
get it!!
Now type:
LIST
And we should have ...
10 CLS
20 PRINT "TONY"
30 CLS
Now type:
30
Then press RETURN.
Then type:
LIST
You will find that line 30 has disappeared.
Try typing:
20
LIST
10
LIST
You should end up back were you started - with nothing on the screen. But
hopefully with something up there between your ears.
So we can now print something on the screen ... can't we? But it would be
better if we had control over where it's printed. For this we use the LOCATE
x,y command.
If you have ever glanced at a manual or if you ever do so, you will see many
commands with x,y after them - x=across, y=down. Therefore LOCATE 2,6 equals
2 places across and 6 places down, LOCATE 6,2 equals 6 places across and 2
places down.
Now type:
10 CLS
20 LOCATE 12,3
30 PRINT "TONY"
Line 10 clears the screen ready for work. Line 20 tells the computer where to
put the next thing it prints. line 30 tells it to print.
Now type:
RUN
And see where it prints it.
Now there is only one way you are going to fully understand the LOCATE x,y
command and that is to change the two numbers in line 20 and re-run it. You can
also change the string in line 30.
Try the following:
10 CLS
20 LOCATE 20,19
30 PRINT "STOSSER"
Now remember the LOCATE x,y command tells the computer where to print the
NEXT string.
Try adding the following lines to your program:
40 LOCATE 5,0
50 PRINT "STOS"
60 LOCATE 15,11
70 PRINT "ATARI"
80 LOCATE 0,5
90 PRINT "I THINK I KNOW WHAT'S HAPPENING"
100 LOCATE 15,7
110 PRINT "A"
KEEP AT IT, I WANT YOU TO CHANGE THE STRING AND THE TWO NUMBERS AT LEAST
TWENTY TIMES.
All done? I do hope you're not cheating!
Let's add a bit of colour to the proceedings shall we. Now printing on the
computer is like writing on paper. We have plenty of commands that deal with
colour but the two we will deal with in this section are PEN and PAPER.
Yes, they are as simple as that, but unfortunately we can't put PEN RED,
PAPER WHITE, that would be too easy.
STOS gives you sixteen colours to choose from, so we have to put something
like this:
PEN 1: PAPER 2
PEN ONE won't do - you must put the actual number.
When STOS boots up it uses colour 0 as the paper and colour 1 as the pen.
Therefore, if you put the command:
PEN 0
The colour of the writing would be the same as that of the background. Then
we would be in a pickle because we wouldn't be able to see it, would we?
As with LOCATE, PEN and PAPER tells the computer the colour to write the NEXT
string in. It will use the same colour for all printing until you tell it not
to. I am going to ask you to type the last bit in now and I want you to type it
all in, no matter how pointless you think it to be.
First though, type:
NEW
Then type:
LIST
You will see that everything is gone, and it's gone forever, so only type NEW
when you want to lose everything on the screen.
Now type the following:
10 CLS
20 PRINT "TONY"
30 PEN 7
40 PRINT "TONY"
50 PAPER 14
60 PRINT "TONY"
70 LOCATE 20,5
80 PEN 8
90 PAPER 4
100 PRINT "TONY"
Well, that's about it for this month. By next month, I will expect you to
know all there is about:
PEN, PAPER, LOCATE, PRINT, CLS, RUN and LIST.
THE ONLY WAY TO LEARN IS TO TYPE IT IN AND SEE WHAT HAPPENS. YOU WON'T HURT
THE COMPUTER, SO GIVE IT SOME STICK AND GET PRACTISING ...
IF YOU ARE NOT 100% SURE ABOUT THESE BY NEXT MONTH'S ISSUE, THEN WRITE TO ME
AND I WILL PUT THE ANSWER TO ANY QUERIES IN THE DISKZINE.
SEE YA NEXT MONTH, STOSSERS!