Introduction to Advanced Basic Commands and Concepts, C-64 PDF
[ Pobierz całość w formacie PDF ]
Copyright
©
1985 by Commodore Electronics Limited
All rights reserved
This course is designed to cover advanced
BASIC commands and concepts for the
Commodore 128, Plus/4 and C16 computers.
This third book in the Programming Course
consists of two parts:
1. A self-study text of 11 units, each cover-
ing commands not covered in the first
two books that focus on the C64.
2. One diskette, containing programs
designed to run on all three computers,
or specifically on the C128 or Plus/4 and
C16.
.
CONTENTS LIST
Title
Subject and Featured Commands or Topics
Page
Introduction
Unit 1
Structured Programming
1
Delays, SLEEP, DO/LOOP, ELSE, BEGIN/BEND
Unit2
Formatting Output
11
PRINT USING, PUDEF
This manual contains copyrighted and proprietary information. No part of
this publication may be reproduced, stored in a retrieval system, or trans-
mitted in any form or by an means, electronic, mechanical, photocopying,
recording or otherwise, without the prior written permission of Commodore
Electronics limited.
Unit3
Finding Program Errors
19
HELP, TRON, TROFF, TRAP, RESUME
Unit4
Screen Editing
29
ESCape key functions, WINDOW
Unit5
Advanced Data Input Using the Keyboard
39
GETKEY, KEY
This software product is copyrighted and all rights reserved by Commodore
Electronics limited. The distribution and sale of this product are intended
for the use of the original purchaser only. Lawful users of these programs
are hereby licensed only to read the programs, from their medium into
memory of a computer, solely for the purpose of executing the programs.
Duplicating, copying, selling ar otherwise distributing this product is a viola-
tion of the law.
Unit6
Case Study: Trivia Program
45
Utilizes commands from Units 1-5
Unit7
Graphic Commands and Drawing
53
GRAPHIC, COlOR, DRAW, LOCATE
Unit8
Higher Level GraphiC Commands
63
BOX, CIRCLE, PAINT
Unit9
Graphic Topics
73
DISCLAIMER
Multicolor graphics, CHAR, SSHAPE, GSHAPE, SCALE
COMMODORE ELECTRONICS LIMITED ("COMMODORE") MAKES NO WARRANTIES,
EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO THE PROGRAMS DESCRIBED
HEREIN. THEIR QUALITY, PERFORMANCE, MERCHANTABILITY, OR FITNESS FOR
ANY PARTICULAR PURPOSE. THESE PROGRAMS ARE SOLD "AS IS." THE ENTIRE
RISK AS TO THEIR QUALITY AND PERFORMANCE IS WITH THE BUYER. SHOULD THE
PROGRAMS PROVE DEFECTIVE FOLLOWING PURCHASE, THE BUYER (AND NOT THE
CREATOR OF THE PROGRAMS, COMMODORE, THEIR DISTRIBUTORS OR THEIR
RETAILERS) ASSUMES THE ENTIRE COST OF ALL NECESSARY DAMAGES. IN NO
EVENT WILL COMMODORE BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL OR
CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT IN THE PROGRAMS
EVEN IF IT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME
LAWS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES
OR LIABILITIES FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE
LIMITATION OR EXCLUSION MAY NOT APPLY.
Unit 10
Sound and Music
83
Plus/4
&
C16: VOl, SOUND
C128: VOl, SOUND, ENVELOPE, TEMPO, PLAY, FILTER
Unit 11
C128 Sprite Commands
101
SPRSAV, SPRDEF, BSAVE, BLOAD, SPRITE, MOVSPR, COlLISION
Appendix A
Applying Relative Coordinates:
111
Turtle Graphics
Appendix B
Answers to Experiments
115
Appendix C
Glossary of Computer Terms
155
Progroms Included on Disk,
By
Unit
• screen editing
• graphic design
Program Name
Unit 1
COlORCHANGE
QUIZl
QUIZ1/4
BOXING
CALORIE COUNTER
• sprites
• sound and music
• other advanced techniques
There are also experiments in each chap-
ter, designed to help you apply what you
learned about the new commands and
concepts to programs or exercises. These
hands-on experiments will increase your
understanding as you use the new informa-
tion in actual programming situations and
problem-solving.
Of
course, if you need a
little help, the answers are in the appendix.
Some discussions in the book may
apply only to a certain version of BASIC or a
certain computer. The section on Sprites, for
example, discusses BASIC 7.0 commands
available only on the C128. Other topics,
such as music, are tailored to your specific
Commodore computer. Most concepts and
commands, however, are relevant to all
three computers, the C128, the Plus/4 and
the C16. A machine-specific topic or com-
mand is designated by a stripe on the upper
corner of the page. Look for this stripe to see
if the concept being presented relates to a
specific computer: a black stripe for BASIC
7.0 and the C128; a gray stripe for BASIC
3.5 and the C16 and Plus/4.
If
there's no
stripe, the material is relevant for all three
computers.
For your convenience, this book in-
cludes a separate disk containing quiz and
demonstration programs and also many of
the longer programs listed in the text.
Because of the differences between differ-
ent versions of BASIC, you'll find certain
programs don't run on your machine. Cer-
tain programs have two versions, one for
the C128 and one for the Plus/4 and C16.
The latter programs appear with a "/4"
tacked on the end of the program name.
Programs without the extra" /4" run either
on the C128 alone, or all three computers.
Whatever computer you have, this
book will help you understand some of the
new commands and concepts of Commo-
dore BASIC.
Unit 2
BANK STATEMENT
MAILING LIST
MAILING L1ST/4
QUIZ2
QUIZ2/4
Unit 3
REAL ESTATE
DEBUG EXERCISE
TRACEEX
This book reviews the advanced BASIC
languages that go beyond the scope of
Commodare 64 BASIC 2.0. In the first two
books, you learned about programming
with the commands available on the Com-
modore 64. But updated, more advanced
versions of the BASIC language that include
the old BASIC commands plus additional
new keywords are being used in the newer
Commodore computers.
Introduction to
Advanced BASIC Commands and Concepts
goes beyond the scope of Commodore
BASIC 2.0 by presenting the keywords used
in the newer Commodore computers. Many
of the new commands in BASIC 3.5 (for the
Plus/4 and C16) and BASIC 7.0 (for the C128)
add versatility to your programs-saving
you time and increasing what you can do
with your computer.
This volume will:
Unit4
EDITQUIZ
EDITQUIZ/4
WINDOW DEMO
WINDOW DEMO 2
GASPUMP
HOROSCOPE
QUIZ4
QUIZ4/4
Unit 5
QUIZ5
QUIZ5/4
Unit6
TRIVIA
TRIVIA/4
TRIVIA/16
Unit7
COLORPLUS
COLORPLUS/4
Unit 8
RUG
TRIANGLES
OCTAGON
PAINTDEMO
HOUSE DRAWING
HOUSE DRAWING/4
• teach you the new, advanced BASIC
commands
Unit9
SWIRLS
SCALES
SCALES/4
QUIZ9
QUIZ9/4
• demonstrate the power of these com-
mands on your computer
• help you design programs which incor-
porate these commands
Unit 10
MAKESSOUND
DEMOSOUND
SWANSONG
Some of the topics explored related to the
new commands are:
Unit 11
FISHTANK
TROPICAL
• structured programming
• formatting output
• the use of windows
• advanced data input
Structured
Programming
This unit introduces commands to help you
improve the structure of your programs. These
allow you to better organize your programs
sequentially, keeping different subroutines in
the order they are used in your program. Struc-
tured programs are easier to follow (particularly
when using flow charts) and mistakes are easier
to track down. Commands reviewed in this unit
that improve structure are DO/LOOP, the
ELSE
clause and BEGIN/BEND.
1
[ Pobierz całość w formacie PDF ]