May June 1980 - Commodore Computers
May June 1980 - Commodore Computers
May June 1980 - Commodore Computers
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
MAY/JUNE, I JUNE. <strong>1980</strong>. 198O. ISSUE 4. 4 COMPUTE. 103 1O3<br />
"ENTER" WITH ATARI<br />
"ENTER" WITH ATARI Len Lindsay<br />
The power to insert or append program segments is<br />
The power to insert or append program segments is<br />
built right into your ATARII computer, even though it<br />
is not mentioned in the ATARI documentation.<br />
Here is an example of how thiss capability can be<br />
utilized. Let's say you just finished ished writing in g a program<br />
called FASTTRAP. You have it saved either on tape<br />
ca lled FASTTRAP. You have it saved either on tape<br />
(CLOAD) or an di sk (SAVE" D:FASTTRAP").<br />
(CLOAD) or an disk (SAVE"D:FASTTRAP").<br />
Now you are developing g another program called<br />
NEWPROG. There are several routines in FAST-<br />
NEWPROG. There are several routines in FAST<br />
TRAP that you would like to include in NEWPROG.<br />
TRAP that you would like to include in NEWPROG.<br />
The hard way to do this, of CO course, UI'se, is to type [hcm them<br />
in again. The easy way is to entcr enter them from<br />
FASTTRAP, and here is how to do it. .<br />
Any program sections that you wish to merge into<br />
another program should be recorded on tape or disk<br />
another program should be recorded on tape or disk<br />
usi ng th e LI ST command. The format for tape is:<br />
using the LIST command. The format for tape is:<br />
LIST"C:",sssss,eeeee<br />
" ,sssss,ccccc<br />
The format forr disk is:<br />
LIST"D:FILENAME",sssss,eeeee<br />
The sssss should be replaced by the starting line<br />
The sssss should be replaced by the starting line<br />
number of the section, and the eeece eeeee should be re<br />
placed by the ending line number. If you wish all<br />
placed by the ending line number. If yo u wish all<br />
th e lines reco rded you may leave air th e lin e<br />
the lines recorded you may leave off the line<br />
numbers.<br />
There are two routines in FASTTRAP that you<br />
There are two routines in FASTTRAP that you<br />
would like to use in NEWPROG. Lines 2000 to<br />
20099 are a routine that allows the ATARI to<br />
determine which plug your joystick is attached ached to.<br />
With the program F ASTTRAP in memory save the<br />
With the program FASTTRAP in memory save the<br />
routine to tape like this: [his:<br />
LIST"C:",20000,20099<br />
or to diskd like this:<br />
LIST"D:IDENTIJST. LIST' ' IDENTIJST .SUB" SUB", ,20000,20099<br />
The other routine in F ASTTRAP you would like to<br />
The other routine in FASTTRAP you would like to<br />
reuse is one that allows the user to easily y choose<br />
what color his piece will be. It is in lines 20300 to<br />
what color his piece will be. It is in lines 20300 to<br />
20399. Save this s routine to tape like this:<br />
LIST"C:",20300,20399<br />
LIST' 'C:" or to disk like this:<br />
LIST"D:COLORSET. LlST" D .SUB" SUB", ,20300,20399<br />
You still have your program FASTTRAP saved on<br />
tape or disk. In addition you now have twO other<br />
tape or disk. In addition you now have two other<br />
tapes or two other disk files, as created above. . Now<br />
type NEW and enter your new program, NEWPROG,<br />
as usual. At any time during your programming ming you<br />
may Ill append the routines previously recorded. Here is<br />
how you would insert sen the routine to set the piece<br />
color from tape:<br />
color from tape:<br />
ENTER"C:"<br />
or from disk:<br />
ENTER"D:COLORSET.SUB"<br />
Now you might as well insert rt your ur other o routine like<br />
this (from tape):<br />
ENTER"C:"<br />
or from disk:<br />
ENTER' ENTER"D:IDENTJST.SUB"<br />
' After Alter yo you u have inserted these, do a LIST aand you<br />
will see that your program does indeed now include<br />
the two routines. Lines ENTERed in this manner wi will<br />
automatically y be placed in the appropriate section of<br />
the program (by line number). If an identical line<br />
number is already used in your program, it will be<br />
replaced by the one you a re ENTERing. You can<br />
replaced by the one you are ENTERing. You can<br />
insen insert or append program sections in any y order you<br />
wish. If you accumulate a library of subroutines<br />
wish. If you accumulate a library of subroutines<br />
in this manner, writing new ATARI programs will<br />
be easier, since some ooff the program is all rcady ready<br />
to go , ready to be ENTERed whenever you need it. ©<br />
to go, ready to be ENTERed whenever you need it. ^<br />
Atari Program<br />
Saving · Part II<br />
Atari Program<br />
Saving-Part II<br />
SAVE"D:FILENAME.EXT"<br />
LOAD"D:FILENAME.EXT"<br />
Len<br />
Lindsay<br />
Lindsay<br />
Last issue I listed some methods of SAVING a<br />
program to tape. Here are the updates for disk. sk.<br />
To save a program to disk in the normal way<br />
(tokenized form) enter this:<br />
SAVE" D:FILENAME.EXT" [RETURN]<br />
[RETURN]<br />
If you have more rc than oneo disk, you can save to disk<br />
sk<br />
number two by using g D2 in place of the D0 in all<br />
examples.<br />
A program saved in this normal manner ner can be<br />
loaded back by this command:<br />
LOAD" D:FILENAME.EXT" [RETURN]<br />
[RETURN]<br />
You also can save your program onto disk in its<br />
untokenized form like this:<br />
LIST"D:FILENAME.EXT"<br />
LIST"D:FILENAME_EXT" [RETURN]<br />
It then can be read back using this command:<br />
:<br />
ENTER"D:FILENAME.EXT" [RETURN]<br />
Using LIST, you can save the whole program (as<br />
above) or just a section of it. To save any section, seClIon,<br />
simply specify the starting and ending line numbers<br />
of that section like this:<br />
s:<br />
LIST"D:FILENAME.EXT", ,100-900<br />
[RETURN]<br />
This will save just lines 100 through 900. ©