KEMBAR78
Mud Slide Slim and The Blue Horizon | PDF | Control Flow | Parameter (Computer Programming)
100% found this document useful (1 vote)
16 views35 pages

Mud Slide Slim and The Blue Horizon

mud slide slim and the blue horizon

Uploaded by

nadezdamand7232
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
16 views35 pages

Mud Slide Slim and The Blue Horizon

mud slide slim and the blue horizon

Uploaded by

nadezdamand7232
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Mud Slide Slim And The Blue Horizon

Order now at alibris.com


( 4.5/5.0 ★ | 304 downloads )
-- Click the link to download --

https://click.linksynergy.com/link?id=*C/UgjGtUZ8&offerid=1494105.26
530075992725224&type=15&murl=http%3A%2F%2Fwww.alibris.com%2Fsearch%2
Fbooks%2Fisbn%2F0075992725224
Mud Slide Slim And The Blue Horizon

ISBN: 0075992725224
Category: Media > Music
File Fomat: PDF, EPUB, DOC...
File Details: 10.4 MB
Language: English
Website: alibris.com
Short description: Good 1989

DOWNLOAD: https://click.linksynergy.com/link?id=*C/UgjGtUZ8&
offerid=1494105.26530075992725224&type=15&murl=http%3A%2F%2F
www.alibris.com%2Fsearch%2Fbooks%2Fisbn%2F0075992725224
Mud Slide Slim And The
Blue Horizon

• Click the link: https://click.linksynergy.com/link?id=*C/UgjGtUZ8&offerid=1494105.2653007599272522


4&type=15&murl=http%3A%2F%2Fwww.alibris.com%2Fsearch%2Fbooks%2Fisbn%2F0075992725224 to do
latest version of Mud Slide Slim And The Blue Horizon in multiple formats such as PDF, EPUB, and
more.
• Don’t miss the chance to explore our extensive collection of high-quality resources, books, and guides on
our website. Visit us regularly to stay updated with new titles and gain access to even more valuable
materials.
.
The text on this page is estimated to be only 21.15%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-9 2 . 7


COMMON Format: COMMON Version: Disk Purpose: To pass
variables to a CHAINed program. Remarks; The COMMON statement
is used in conjunction with the CHAIN statement. COMMON
statements may appear anywhere in a program, though it is
recommended that they appear at the beginning. The same variable
cannot appear in more than one COMMON statement. Array
variables are specified by appending "{)" to the variable name. If all
variables are to be passed, use CHAIN with the ALL option and omit
the COMMON statement. Example: 100 COMMON A,B,C,D(),G$ 110
CHAIN "PROG3",10 NOTE: The BASIC Compiler supports a modified
version of the COMMON statement. The COMMON statement must
appear in a program before any executable statements- The current
non-executable statements are : COMMON DEFDBL, DEFINT,
DEFSNG, DEFSTR DIM OPTION BASE REM % INCLUDE Arrays in
COMMON must be declared in preceding DIM statements. The
standard form of the COMMON statement is referred to as blank
COMMON. FORTRAN style named COMMON areas are also
supported; however, the variables are not preserved across CHAINS.
The syntax for named COMMON is as follows: COMMON /NAME>/
LIST of variables> where NAME> is 1 to 6 alphanumeric characters
starting with a letter- This is useful for communicating with
FORTRAN and assembly language routines without having to
explicityly pass parameters in the CALL statement.
The text on this page is estimated to be only 22.38%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-10 The


blank COMMON size and order of variables must be the same in the
CHAINing and CHAINed-to programs- With the BASIC Compiler, the
best way to insure this is to place all blank COMMON declarations in
a single include file and use the %INCLUDE statement in each
program- For example : MENU. HAS 10 % INCLUDE COMDEF 1000
CHAIN "PROGl" PROGl.BAS 10 %INCLUDE COMDEF . 2000 CHAIN
"MENU COMDEF -HAS 100 DIM A(IOO) ,B$(200) 110 COMMON
I,J,K,A, {) 120 COMMON A?,B$, 0 ,X,Y,Z
The text on this page is estimated to be only 21.47%
accurate

BASIC-BO COMMANDS AND STATEMENTS Page 2-11 2,8


CONT Format: CONT Versions: 8K, Extended, Disk Purpose: To
continue program execution after a Control-C has been typed, or a
STOP or END statement has been executed. Remarks: Execution
resumes at the point where the break occurred. If the break
occurred after a prompt from an INPUT statement, execution
continues with the reprinting of the prompt (? or prompt string) .
CONT is usually used in conjunction with STOP for debugg ing .
When execution is stopped , intermediate values may be examined
and changed using direct mode statements. Execution may be
resumed with CONT or a direct mode GOTO, which resumes
execution at a specified line number. With the Extended and Disk
versions, CONT may be used to continue execution after an error.
CONT is invalid if the program has been edited dur ing the break - In
8K BASIC-80 , execution cannot be CONTinued if a direct mode error
has occurred during the break. Example: See example Section 2.61,
STOP 
The text on this page is estimated to be only 26.08%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-12 2.9


CSAVE Formats: CSAVE < string express ion > CSAVE* Versions: 8K
(cassette). Extended (cassette) Purpose: To save the program or an
array currently in memory on cassette tape. Remarks: Each program
or array saved on tape is identified by a filename- When the
command CSAVE is executed, BASIC-80 saves the program currently
in memory on tape and uses the first character in < string
expression> as the filename- may be more than one character, but
only the first character is used for the filename. When the command
CSAVE* is executed, BASIC-80 saves the specified array on tape.
The array must be a numeric array. The elements of a
multidimensional array are saved with the leftmost subscript
changing f as test CSAVE may be used as a program statement or as
a direct mode commandBefore a CSAVE or CSAVE* is executed,
make sure the cassette recorder is properly connected and in the
Record mode. See also CLOAD, Section 2.5. NOTE: CSAVE and
CLOAD are not included in all implementations of BASIC-80.
Example: CSAVE "TIMER" Saves the program currently in memory on
cassette under filename "T".
The text on this page is estimated to be only 23.81%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-13 2.10


DATA Format: DATA Versions: BK, Extended, Disk Purpose: To store
the numeric and string constants that are accessed by the program'
s READ statement (s) (See READ, Section 2.54) Remarks: DATA
statements are nonexecutable and may be placed anywhere in the
program. A DATA statement may contain as many constants as will
fit on a line (separated by commas) , and any number of DATA
statements may be used in a program. The READ statements access
the DATA statements in order (by line number) and the data
contained therein may be thought of as one continuous list of items,
regardless of how many items are on a line or where the lines are
placed in the program. may contain numeric constants in any
format, i.e. , fixed point, floating point or integer . (No numeric
expressions are allowed in the list.) String constants in DATA
statements must be surrounded by double quotation marks only if
they contain commas, colons or significant leading or trailing spaces.
Otherwise, quotation marks are not needed The variable type
(numeric or string) given in the READ statement must agree with the
corresponding constant in the DATA statement. DATA statements
may be reread from the beginning by use of the RESTORE statement
(Section 2.57). Example: See examples in Section 2.54, READ.
The text on this page is estimated to be only 26.97%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-14 2.11


DEF FN Format: DEF FN [ {) ] = Versions: 8K, Extended, Disk
Purpose: To define and name a function that is written by the user.
Remarks: must be a legal variable name. This name , preceded by
FN, becomes the name of the function. is comprised of those
variable names in the function definition that are to be replaced
when the function is called. The items in the list are separated by
commas. is an expression that performs the operation of the
function. It is limited to one line. Variable names that appear in this
expression serve only to define the function; they do not affect
program variables that have the same name. A variable name used
in a function definition may or may not appear in the parameter list-
If it does, the value of the parameter is supplied when the function
is called. Otherwise, the current value of the variable is used. The
variables in the parameter list represent, on a one-to-one basis, the
argument variables or values that will be given in the function call,
(Remember, in the 8K version only one argument is allowed in a
function call, therefore the DEF FN statement will contain only one
variable.) In Extended and Disk BASIC-80, user-defined functions
may be numeric or string; in 8K, user-defined string functions are
not allowed. If a type is specified in the function name , the value of
the expression is forced to that type before it is returned to the
calling statement. If a type is specified in the function name and the
argument type does not match , a "Type mismatch" error occurs. A
DEF FN statement must be executed before the function it defines
may be called. If a function is called before it has been defined, an
"Undefined user function" error occurs- DEF FN is illegal in the direct
mode.
The text on this page is estimated to be only 20.92%
accurate

BASIC-BO COMMANDS AND STATEMENTS Page 2-15


Example: 410 DEF FNAB(X,y)=X"3/y"2 420 T=FNAB{I,J) Line 410
defines the function FNAB. The function is called in line 420.
The text on this page is estimated to be only 21.22%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-16 2.12


DEFINT/SNG/DBL/STR Format: Versions Purpose : Remarks:
Examples: DEF where is INT, SNG, DBL, or STR Extended, Disk To
declare variable types as integer, precision, double precision, or
stringsingle will be that declaration A DEFtype statement declares
that the variable names beginning with the letter (s) specified type
variable. However, a type character always takes precedence over a
DEFtype statement in the typing of a variable. If no type declaration
statements are encountered, BASIC-80 assumes all variables without
declaration characters are single precision variables. 10 DEFDBL L-P
All variables beginning with the letters L, M, N, O, and P will be
double precision variables. 10 DEFSTR A Ail variables beginning^
with the letter A will be string variables. 10 DEFINT I-N,W-2 All
variable beginning with the letters I, J, K, L, M, N, W, X, Y, 2 will be
integer variables.
The text on this page is estimated to be only 21.47%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-17 2.13


DEF USR Format: Versions Purpose: Remarks; DEF USR[] s=
Extended, Disk To specify the starting address of an assembly
language subroutine may be any digit from 0 to 9. The digit
corresponds to the number of the USR routine whose address is
being specified. If is omitted, DEF USRO is assumed- The value of <
integer expression> is the starting address of the USR routine- See
Appendix C, Assembly Language Subroutines. Any number of DEF
USR statements may appear in a program to redefine subroutine
starting addresses, thus allowing access to as many subroutines as
necessary* Example : 200 DEF USR0=24000 210 X=USR0{Y''2/2-89)
The text on this page is estimated to be only 22.07%
accurate

BASIC-BO COMMANDS AND STATEMENTS Page 2-18 2.14


DELETE Format; DELETE[] [-] Versions: Extended, Disk Purpose: To
delete program lines. Remarks: BASIC-80 always returns to
command level after a DELETE is executed- If does not exist, an
"Illegal function call" error occurs. Examples: DELETE 40 Deletes line
40 DELETE 40-100 Deletes lines 40 through 100, inclusive DELETE-
40 Deletes all lines up to and including line 40
The text on this page is estimated to be only 15.20%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-19 2,15


DIM Format: DIM Versions: 8K, Extended, Disk Purpose: To specify
the maximum values for array variable subscripts and allocate
storage accordingly. Remarks: If an array variable name is used
without a DIM statement, the maximum value of its subscript (s) is
assumed to be 10, If a subscript is used that is greater than the
maximum specified, a "Subscript out of range" error occurs. The
minimum value for a subscript is always 0 , unless otherwise
specified with the OPTION BASE statement (see Section 2.46). The
DIM statement sets all the elements of the specified arrays to an
initial value of 2ero, Example: 10 DIM A (20) 20 FOR 1=0 TO 20 30
READ A(I) 40 NEXT I
The text on this page is estimated to be only 17.61%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-20 2.16


EDIT Format: EDIT Versions: Extended, Disk Purpose : To enter Edit
Mode at the specified lineRemarks: In Edit Mode » it is possible to
edit portions of a line without retyping the entire line- Upon entering
Edit Mode, BASIC-BO types the line number of the line to he edited,
then it types a space and waits for an Edit Mode subcommandEdit
Mode Subcommands Edit Mode subcommands are used to move the
cursor or to insert, delete, replace, or search for text within a line.
The subcommands are not echoed. Most of the Edit Mode
subcommands may be preceded by an integer which causes the
command to be executed that number of timesWhen a preceding
integer is not specified, it is assumed to be 1. Edit Mode
subcommands may be categorized according to the following
functions: 1. Moving the cursor 2. Inserting text 3 . Deleting text 4 .
Finding text 5. Replacing text 6- Ending and restarting Edit Mode
NOTE In the descriptions that follow, represents any character,
represents a string of characters of arbitrary length, [i] represents an
optional integer (the default is 1) , and $ represents the Escape (or
Alt mode) key.
The text on this page is estimated to be only 23.25%
accurate

BASlC-80 COMMANDS AND STATEMENTS Page 2-21 1.


Moving the Cursor Space Use the space bar to move the cursor to
the right. [i] Space moves the cursor i spaces to the right.
Characters are printed as you space over them. Rubout In Edit
Mode, [i] Rubout moves the cursor i spaces to the left (backspaces)
. Characters are printed as you backspace over them. 2- Inserting
Text I I5 inserts at the current cursor position- The inserted
characters are printed on the terminal- To terminate insertion, type
Escape- If Carriage Return is typed during an Insert command, the
effect is the same as typing Escape and then Carriage Return.
During an Insert command, the Rubout, Delete, or Underscore key
on the terminal may be used to delete characters to the left of the
cursor. Rubout will print out the characters as you backspace over
them. Delete and Underscore will print an Underscore for each
character that you backspace over- If an attempt is made to insert a
character that will make the line longer than 255 characters, a bell
(Control-G) is typed and the character is not printed. X The X
subcommand is used to extend the line- X moves the cursor to the
end of the line, goes into insert mode, and allows insertion of text as
if an Insert command had been given- When you are finished
extending the line, type Escape or Carriage Return. 3, Deleting Text
D [i]D deletes i characters to the right of the cursor. The deleted
characters are echoed between backslashes, and the cursor is
positioned to the right of the last character deleted. If there are
fewer than i characters to the right of the cursor, iD deletes the
remainder of the lineH H deletes all characters to the right of the
cursor and then automatically enters insert mode- H is useful for
replacing statements at the end of a line4. Finding Text S The
subcommand [ i ] S searches for the ith
The text on this page is estimated to be only 25.55%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-22


occurrence of and positions the cursor before it. The character at the
current cursor position is not included in the search. If is not found,
the cursor will stop at the end of the line. All characters passed over
during the search are printed. K The subcommand IilK is similar to
Ii]S, except all the characters passed over in the search are deleted.
The cursor is positioned before , and the deleted characters are
enclosed in backslashesReplacing Text C The subcommand C
changes the next character to . If you wish to change the next i
characters, use the subcommand iC, followed by i characters. After
the ith new character is typed, change mode is exited and you will
return to Edit ModeEnding and Restarting Edit Mode Typing Carriage
Return prints the remainder of the line, saves the changes you made
and exits Edit Mode. E The E subcommand has the same effect as
Carriage Return, except the remainder of the line is not printed. Q
The Q subcommand returns to BASIC-80 command level, without
saving any of the changes that were made to the line during Edit
Mode. li The L subcommand lists the remainder of the line (saving
any changes made so far) and repositions the cursor at the
beginning of the line, still in Edit Mode- L is usually used to list the
line when you first enter Edit Mode. A The A subcommand lets you
begin editing a line over again. It restores the original line and
repositions the cursor at the beginning. NOTE If BASIC-80 receives
an unrecognizable command or illegal character while in Edit Mode,
it prints a bell (Control-G) and the command or character is ignored.
The text on this page is estimated to be only 27.51%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-23 Syntax


Errors When a Syntax Error is encountered during execution of a
program, BASIC-80 automatically enters Edit Mode at the line that
caused the error* For example : 10 K = 2(4) RUN ?Syntax error in
10 10 When you finish editing the line and type Carriage Return (or
the E subcommand) , BASIC-BO reinserts the line, which causes all
variable values to be lost. To preserve the variable values for
examination , first exit Edit Mode with the Q subcommand. BASIC-80
will return to command level, and all variable values will be
preservedControl-A To enter Edit Mode on the line you are currently
typing , type Control-A- BASIC-80 responds with a carriage return,
an exclamation point (!) and a space. The cursor will be positioned
at the first character in the line. Proceed by typing an Edit Mode
subcommand. NOTE Remember, if you have just entered a line and
wish to go back and edit it, the command "EDIT." will enter Edit
Mode at the current line. (The line number symbol " . " always refer
s to the current line. )
The text on this page is estimated to be only 20.71%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-24 2.17


END Format: END Versions: 8K, Extended, Disk Purpose: To
terminate program execution, close all files and return to command
level . Remarks: END statements may be placed anywhere in the
program to terminate execution- Unlike the STOP statement/ END
does not cause a BREAK message to be printed. An END statement
at the end of a program is optional. BASIC-80 always returns to
command level after an END is executedExample: 520 IF K>1000
THEN END ELSE GOTO 20
The text on this page is estimated to be only 12.44%
accurate

BA5IC-80 COMMANDS AND STATEMENTS Page 2-25 2.18


ERASE Format: Versions: Purpose: Remarks: VOTE: Example ;
ERASE Extended, Disk To eliminate arrays from a program. Ar rays
may be redimensioned after they are ERASEd, or the previously
allocated array space in memory may be used for other purposes. If
an attempt is made to redimension an array without first ERASEing
it, a "Redimensioned array" error occur sThe Microsoft BASIC
compiler <3oes not support ERASE, 450 ERASE A,B 460 DIM B(99)
The text on this page is estimated to be only 16.59%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-26 2. 19


ERR AND ERL VARIABLES When an error handling subroutine is
entered, the variable ERR contains the error code for the error and
the variable ERL contains the line number of the line in which the
error was detected. The ERR and ERL variables are usually used in
IF THEN statements to direct program flow in the error trap routine.
If the statement that caused the error was a direct mode statement,
ERL will contain 65535. To test if an error occurred in a direct
statement, use IF 65535 = ERL THEN ... Otherwise, use IF ERR =
error code THEN ... IF ERL = line number TEEVi ... If the line
number is not on the right side of the relational operator, it cannot
be renumbered by RENUM, Because ERL and ERR are reserved
variables, neither may appear to the left of the equal sign in a LET
(assignment) statement, BASIC-80 's error codes are listed in
Appendix J. (For Standalone Disk BASIC error codes, see Appendix
H.)
The text on this page is estimated to be only 24.09%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-27 2.20


ERROR Format: ERROR < integer express ion> Versions: Extended,
Disk Purpose: 1) To simulate the occurrence of a BASIC-80 error; or
2) to allow error codes to be defined by the user. Remarks: The
value of < integer express ion> must be greater than 0 and less
than 255- If the value of < integer express ion> equals an error
code already in use by BASIC-80 (see Appendix J) , the ERROR
statement will simulate the occurrence of that error, and the
corresponding error message will be printed- (See Example 1.) To
define your own error code, use a value that is greater than any
used by BASIC-80 's error codes- (It is preferable to use the highest
available values, so compatibility may be maintained when more
error codes are added to BASIC-BO.) This user-defined error code
may then be conveniently handled in an error trap routine, (See
Exafnple 2.) If an ERROR statement specifies a code for which no
error message has been defined, BASIC-80. responds with the
message UNPRINTABLE ERROR. Execution of an ERROR statement
for which there is no error trap routine causes an error message to
be printed and execution to haltExample 1: LIST 10 S = 10 20 T = 5
30 ERROR S + T 40 END Ok RUN String too long in line 30 Or , in
direct mode : Ok ERROR 15 (you type this line) String too long
(BASIC-80 types this line) Ok
The text on this page is estimated to be only 21.62%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-28


Example 2: 110 ON ERROR GOTO 400 120 INPUT "WHAT IS YOUR
BET";B 130 IF B > 5000 THEN ERROR 210 400 IF ERR = 210 THEN
PRINT "HOUSE LIMIT IS $5000" 410 IF ERL =130 THEN RESUME
120
The text on this page is estimated to be only 27.22%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-29 2.21


FIELD Format: FIEI.D[#] , AS Version: Disk Purpose: To allocate
space for variables in a random file bufferRemarks: To get data out
of a random buffer after a GET or to enter data before a PUT, a
FIELD statement must have been executed. is the number under
which the file was OPENed. is the number of characters to be
allocated to . For example, FIELD 1, 20 AS N$ , 10 AS ID$ , 40 AS
ADD$ allocates the first 20 positions (bytes) in the random file buffer
to the string variable N$, the next 10 positions to ID$, and the next
40 positions to ADD$. FIELD does NOT place any data in the random
file buffer. (See LSET/RSET and GET,) The total number of bytes
allocated in a FIELD statement must not exceed the record length
that was specified when the file was OPENed. Otherwise, a "Field
overflow" error occurs, (The default record length is 128.) Any
number of FIELD statements may be executed for the same file, and
all FIELD statements that have been executed are in effect at the
same time. Example: See Appendix B. NOTE: Do not use a FIELDed
variable name in an INPUT or LET statement. Once a variable name
is FIELDed, it points to the correct place in the random file buffer. If
a subsequent INPUT or LET statement with that variable name is
executed, the variable's pointer is moved to string space.
The text on this page is estimated to be only 19.62%
accurate

BA5IC-80 COMMANDS AND STATEMENTS Page 2-30 2.22


FOR. . .NEXT Forinat: FOR =x TO y (STEP z] NEXT [) [, ] where x, y
and z are numeric expressions. Versions: 8K, Extended, Disk
Purpose: To allow a series of instructions to be performed in a loop a
given number of times. Remarks: is used as a counter. The first
numeric expression (x) is the initial value of the counter. The second
numeric expression (y) is the final value of the counter. The program
lines following the FOR statement are executed until the NEXT
statement is encountered. Then the counter is incremented by the
amount specified by STEP, A check is performed to see if the value
of the counter is now greater than the final value (y) - If it is not
greater, BASIC-80 branches back to the statement after the FOR
statement and the process is repeated. If it is greater , execution
continues with the statement following the NEXT statement- This is
a FOR- -.NEXT loop. If STEP is not specified, the increment is
assumed to be one. If STEP is negative, the final value of the
counter is set to be less than the initial value. The counter is
decremented each time through the loop, and the loop is executed
until the counter is less than the final value. The body of the loop is
skipped if the initial value of the loop times the sign of the step
exceeds the final value times the sign of the step. Nested Loops
FOR. ..NEXT loops may be nested, that is, a FOR... NEXT loop may
be placed within the context of another FOR. , .NEXT loop. When
loops are nested, each loop must have a unique variable name as its
counter- The NEXT statement for the inside loop must appear before
that for the outside loop- If nested loops have the same end point, a
single NEXT statement may be used for all of themThe variable (s) in
the NEXT statement may be
The text on this page is estimated to be only 22.13%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-31


omitted, in which case the NEXT statement will match the most
recent FOR statement. If a NEXT statement is encountered before its
corresponding FOR statement, a "NEXT without FOR" error message
is issued and execution is terminated , Example 1: 10 K=10 20 FOR
1=1 TO K STEP 2 30 PRINT I; 40 K=K+10 50 PRINT K 60 NEXT RUN
1 20 3 30 5 40 7 50 9 60 Ok Example 2: 10 J=a 20 FOR 1=1 TO J
30 PRINT I 40 NEXT I In this example , the loop does not execute
because the initial value of the loop exceeds the final valueExample
3: 10 1=5 20 FOR 1=1 TO 1+5 30 PRINT I; 4 0 NEXT RUN
123456789 10 Ok In this example, the loop executes ten times. The
final value for the loop variable is always set before the initial value
is set. {Note: Previous versions of BASIC-80 set the initial value of
the loop variable before setting the final value; i.e., the above loop
would have executed six times,)
The text on this page is estimated to be only 14.56%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-32 2,23


GET Format: GET [#3 [ r ] Version: Disk Purpose: To read a record
from a random disk file into a random buffer. Remarks : is the
number under which the file was OPENed. If is omitted, the next
record (after the last GET) is read into the buffer. The largest
possible record number is 32767. Example: See Appendix B. NOTE:
After a GET statement, INPUTS and LINE INPUT* may be done to
read characters from the random file buffer.
The text on this page is estimated to be only 22.57%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-33 2.24


GOSUB. . -RETURN Format: GOSUB Versions Purpose : Remarks:.
Example: RETURN 8K, Extended, Disk To branch to and return from
a subroutine. subroutine. is the first line of the return at Subroutines
but it is be readily A subroutine may be called any number of times
in a program, and a subroutine may be called from within another
subroutine. Such nesting of subroutines is limited only by available
memoryThe RETURN statement (s) in a subroutine cause BASIC-80
to branch back to the statement following the most recent GOSUB
statement, A subroutine may contain more than one RETURN
statement, should logic dictate a different points in the subroutine,
may appear anywhere in the program, recommended that the
subroutine distinguishable from the main program. To prevent
inadvertant entry into the subroutine, it may be preceded by a STOP,
END, or GOTO statement that directs program control around the
subroutine. 10 GOSUB 40 20 PRINT "BACK FROM SUBROUTINE" 30
END 40 PRINT "SUBROUTINE"; 5 0 PRINT " IN"; 60 PRINT "
PROGRESS" 70 RETURN RUN SUBROUTINE IN PROGRESS BACK
FROM SUBROUTINE Ok
The text on this page is estimated to be only 19.97%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-34 2-25


GOTO Format: Versions Purpose: Remarks: GOTO <1 i ne numbe r
> 8K, Extended, Disk To branch unconditionally out of the normal
program sequence to a specified line number. If is an executable
statement, that statement and those following are executed. If it is a
nonexecutable statement, execution proceeds at the first executable
statement encountered after . Example: LIST 10 READ R 20 PRINT
"R =";R, 30 A = 3-14*R'^2 40 PRINT "AREA =";A 50 GOTO 10 60
DATA 5,7,12 Ok RUN R = 5 AREA = 78.5 R = 7 AREA = 153.86 R =
12 AREA = 452.16 ?Out of data in 10 Ok
The text on this page is estimated to be only 15.74%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-35 2.26


IF. ..THEN[,. ,ELSE] AND IF.. -GOTO Focmat: IF THEN | (ELSE (
GOTO [ELSE | ] Versions: 8K, Extended, Disk NOTE; The ELSE clause
is allowed only in Extended and Disk versionsPurpose: To make a
decision regarding program flow based on the result returned by an
expression. Remarks: If the result of is not zero, the THEN or GOTO
Clause is executed, THEN may be followed by either a line number
for branching or one or more statements to be executed. GOTO is
always followed by a line number. If the result of is zero, the THEN
or GOTO clause is ignored and the ELSE clause, if present, is
executed- Execution continues with the next executable statement.
(ELSE is allowed only in Extended and Disk versions.) Extended and
Disk versions allow a comma before THEN, Nesting of IF Statements
In the Extended and Disk versions, IF. , .THEN. . .ELSE statements
may be nested. Nesting is limited only by the length of the line. For
example IF X>Y THEN PRINT "GREATER" ELSE IF Y>X THEN PRINT
"LESS THAN" ELSE PRINT "EOOAL" is a legal statement. If the
statement does not contain the same number of ELSE and THEN
clauses, each ELSE is matched with the closest unmatched THEN.
For example IF A=B THEN IF B=C THEN PRINT "A=C" ELSE PRINT
"hoc" will not print "A<>C" when AOB. If an IF. , -THEN statement is
followed by a line number in the direct mode , an "Undefined line"
error results unless a statement with the specified line number had
previously been entered in the indirect mode.
The text on this page is estimated to be only 23.53%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-36 NOTE:


When using IF to test equality foe a value that is the result of a
floating point computation, remeinber that the internal
representation of the value may not be exact. Therefore, the test
should be against the range over which the accuracy of the value
may vary. For example, to test a computed variable A against the
value 1,0, use: IF ABS (A-1.0) 10) THEN DB=1979-1 :GOTO 300 110
PRINT "OUT OF RANGE" In this example , a test determines if I is
greater than 10 and less than 20. If I is in this range, DB is
calculated and execution branches to line 300. If I is not in this
range, execution continues with line 110. Example 3: 210 IF lOFLAG
THEN PRINT A$ ELSE LPRINT A$ This statement causes printed
output to go either to the terminal or the line printer, depending on
the value of a variable (lOFLAG) . If lOFLAG is zero, output goes to
the line printer, otherwise output goes to the terminal.
The text on this page is estimated to be only 20.92%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-37 2,27


INPUT Format: INPUT[ ; ] [ ; ] Versions: 8K, Extended, Disk
Purpose: To allow input from the terminal during program
executionRemarks: When an INPUT statement is encountered,
program execution pauses and a question mark is printed to indicate
the program is waiting for data. If is included, the string is printed
before the question- mark. The required data is then entered at the
terminal. A comma may be used instead of a semicolon after the
prompt string to suppress the question mark. For example, the
statement INPUT "ENTER BIRTHDATE" ,B$ will print the prompt with
no question mark. If INPUT is immediately followed by a semicolon,
then the carriage return typed by the user to input data does not
echo a carriage return/line feed sequence. The data that is entered
is assigned to the variable (s) given in . The number of data items
supplied must be the same as the number of variables in the list-
Data items are separated by commasThe variable names in the list
may be numeric or string variable names (including subscripted
variables) . The type of each data item that is input must agree with
the type specified by the variable name. (Strings input to an INPUT
statement need not be surrounded by quotation marks- )
Responding to INPUT with too many or too few items, or with the
wrong type of value (numeric instead of string, etc.) causes the
messsage "?Redo from start" to be printed- No assignment of input
values is made until an acceptable response is given, In the 8K
version, INPUT is illegal in the direct mode.
The text on this page is estimated to be only 14.34%
accurate

BASIC-80 COMMANDS AND STATEMENTS Page 2-38


Examples: 10 INPUT X 20 PRINT X "SQUARED IS" X*2 30 END RUN
? 5 (The 5 was typed in by the user in response to the question
mark.) 5 SQUARED IS 25 Ok LIST 10 PI=3.14 20 INPUT "WHAT IS
THE RADIUS" ;R 30 A=PI*R'*2 40 PRINT "THE AREA OF THE
CIRCLE IS";A 50 PRINT €0 GOTO 20 Ok RUN WHAT IS THE
RADIUS? 7.4 (User types 7-4) THE AREA OF THE CIRCLE IS 171.946
WHAT IS THE RADIUS? etc 

You might also like