SECTION 16

[continue/next section] [MAIN/Introduction] [table of contents]

16. Introduction


TABLE OF CONTENTS

16.1 ORGANIZATION OF ENCYCLOPAEDIA

16.2 COMMAND AND STATEMENT FORMAT

16.3 GRAPHIC AND SOUND COMMAND FORMAT

16.4 DISK COMMAND FORMAT

16.1 ORGANIZATION OF ENCYCLOPAEDIA

This chapter lists BASIC 7.0 language elements and describe how to use those elements. It gives a complete list of the rules (syntax) of Commodore 128 BASIC 7.0, along with a concise description of each.

Basic 7.0 includes all the elements of BASIC 2.0. The new commands, statements, functions and operators provided in Basic 7.0 are shown as follows:

*AUTO*

and commands which have been modified are as follows:

RUN / *RUN*

The different types of BASIC operations are listed in individual sections, as follows:

  1. COMMANDS AND STATEMENTS: the commands used to edit, store and erase programs; and the BASIC program statements used in the numbered lines of a program.
  2. FUNCTIONS: the string, numeric and print functions.
  3. VARIABLES AND OPERATORS: the different types of variables, legal names, arithmetic operators and logical operators.
  4. RESERVED WORDS, SYMBOLS AND ABBREVIATIONS: the words, symbols and abbreviations reserved for use in the BASIC 7.0 language, and which cannot be used for any other purpose.

16.2 COMMAND AND STATEMENT FORMAT

command name ->

 

*AUTO*

 

brief description ->

Enable/disable automatic line numbering

 

command format ->

AUTO [line#]

 

Discussion of format and use ->

This command turns on the automatic line-numbering feature. This eases the job of entering programs, by automatically typing the line numbers for the user. As each program line is entered by pressing {return}, the next line number is printed on the screen, and the cursor is positioned two spaces to the right of the line number. The line number argument refers to the desired increment between line numbers. AUTO without an argument turns off the auto line numbering, as does RUN. This statement can be used only indirect mode (outside of a program).

 

Example(s) ->

EXAMPLES:

AUTO 10
Automatically numbers program lines in increments of 10.

AUTO 50
Automatically numbers lines in increments of 50

AUTO
Turns off automatic line numbering.

The boldface line that defines the format consists of the following elements:

DLOAD "program name" [D0,U8]
  ^             ^         ^
  |             |         |   additional arguments
keyword      argument     +--  (possibly optional)

The parts of the command or statement that must be typed exactly are shown in capital letters. Words the user supplies, such as the name of a program, are not capitalized.

When quote marks (" ") appear (usually around a program name or file name), the user should include them in the appropriate place, according to the format example.

KEYWORDS, also called reserved words, appear in upper case letters. Keywords may be typed using the full word or the approved abbreviation (a full list is given in Appendix K). The keyword or abbreviation must be entered correctly or an error will result. The BASIC and DOS error messages are defined in Appendices A and B, respectively.

Keywords are words that are part of the BASIC language. The are the central part of a command or statement, and the tell the computer what kind of action to take. These words cannot be used as variable names. A complete list of reserved words is given in Section 20.

ARGUMENTS, also called parameters, appear in lower case letters. Arguments complement keywords by providing specific information to the command or statement. For example, the keyword LOAD tells the computer to load a program while the argument tells the computer which specific program to load. A second argument specifies from which drive to load the program. Arguments include filenames, variables, line numbers, etc.

SQUARE BRACKETS [ ] show optional arguments. The user selects any or none of the arguments listed, depending on requirements. The user should not type the SQUARE BRACKETS, which are only there to describe the format.

ANGLE BRACKETS < > indicate the user MUST choose one of the arguments listed. The user should not type the ANGLE BRACKETS, which are only there to describe the format.

A VERTICAL BAR | seperates items in a list of arguments when the choices are limited to those arguments listed. When the vertical bar appears in a list enclosed by SQUARE BRACKETS, the choices are limited to the items in the list, but the user still has the option not to use any arguments.

ELIPSIS ... a sequence of three dots means an option or argument can be repeated more than once. The user should not type the ELIPSIS, which is only there to describe the format.

QUOTATION MARKS " " enclose character strings, filenames and other expressions. When arguments are enclosed in quotation marks, the quotation marks must be included in the command or statement. Quotations marks are not conventions used to describe formats; they are required parts of a command or statement.

PARENTHESES ( ) When arguments are enclosed in parentheses, they must be included in the command or statement. Parentheses are not conventions used to describe formats; they are required parts of a command or statement.

VARIABLE refers to any valid BASIC variable name, such as X, A$, T%, etc.

EXPRESSION refers to any valid BASIC expression, such as A+B+2, 5*(X+3), etc.

COMMAS (,) COLONS (:) and SEMICOLONS (;) These MUST be included, they are required parts of the command or statement.

16.3 GRAPHIC AND SOUND COMMAND FORMAT

Optional parameters in Graphics and Sound commands are represented like this:

[,parameter]

When parameters are omitted the comma MUST be included, this is because the parameters are position dependent. You must not, however, include commas after the last specified parameter.

EXAMPLE:

ENVELOPE n [,atk] [,dec] [,sus] [,rel] [,wf] [,pw]

To alter just the rel parameter, use:

ENVELOPE n,,,,rel

The first three commas mark the positions of atk, dec, sus and the fourth is the comma for rel. The commas for wf and pw must not be entered.

In the GRAPHICS commands whenever there is a coordinate specified by (X,Y) it is possible to replace this with a vector (X;Y). In this case:

  • X is the distance (scaled)
  • Y is the angle in degrees (0 = up; 90 = right etc.)

For example:

LOCATE 160,100
DRAW TO 40;45
will draw a line at 45 degrees of length 40.

16.4 DISK COMMAND FORMAT

Optional parameters in disk commands are shown thus:

[,parameter]

The comma is not required if the parameter is the first after the command itself. If other parameters which require commas are omitted the commas should be omitted too.

EXAMPLE:

DIRECTORY [Ddrive][<ON | ,>Udevice number] [,wildcard]
would in full produce:
DIRECTORY D0 ON U8,"AB*"

To specify only the wild card, no comma is required, i.e.

DIRECTORY "AB*"

Whenever variables are used in disk commands the MUST be enclosed in parentheses ( ). For example:

DIRECTORY D(DV),(A$)

[top of document]

page URL: www.bigfoot.com/~c128page/c128sg/sect-16.htm
contact: c128page@bigfoot.com