• Keine Ergebnisse gefunden

SUM: TOTAL% = TOTAL%+I% RETURN 9999 END

Ii iNB f~UMBER lOR/TOTAL) IMP TEST~

60 SUM: TOTAL% = TOTAL%+I% RETURN 9999 END

Example:

-LIST

10 FOR Ii=1 TO 4 20 l?RINT Ii 30 GOSUB SUM

40 NEXT

50 GOTO 9999

60 SUM: TOTAL% = TOTAL%+I% RETURN 9999 END

-BREAK AT SUM

-BREAK ON 1%' CHANGE AFTER 4 -BREAK

Break at SUM

Break on I% changed after 4 -RUN

Break at line 60 -VARS TOTAL%

TOTAL% = 0 -VARS 1%

1%

=

1

-UNBREAK AT SUM -CONTINUE

Break on I% at line 40 -VARS I%,TOTAL%

I%

=

4

TOTAL% = 6

. .

===================================================================================

BASIC ley B - 113 - BUll:

B.lSXC· BBFEIIBIICB MDUAL

2 CRIWGB (charX&o. atriDsXcharXto atrJ.DgXchar)

,

3 CIWIGB (charX&o. striDsXcharxto striDsXcharXraDge) Where:

<char>

::=

<delimiting character>

<from string> ::= <string>

<to string) ::= <string>

<range> ::= <line number>[ <line number>]

See also: MODIFY command

CBlP1BI 8: CCIIIDDS-8.5 CCMrUUB Co-end

---~---~---~---I

1 CCMrDUB I

I-I

---~~---Purpo_:

The CONTINUE command allows you to' resume exe.cution of a program that was interrupted.

ec..ent:

The CONTINUE command, when executed.! will continue the execution of a program whose execution was interrupted by a STuP statement, an error, or entry of the Program Cancel-Key.

When a program has a normal exit, i.e., execution of the END stateme~t, the CONTINUE command has no 'effect.

The CONTINUE command is a valuable debugging aid. If a "bug" is suspected in a portion of a prog~aml STOP statements may be inserted at strategic positions of the.

program. When the ~TOP is executed, you may use the commands to examine variables and/or change statements in the program and continue execution. If an error occurs, you may examine the suspected statement and change it as required and continue execution.

When an error occurs, a CONTINUE command will re-execute the line that contained the statement that was interrupted. If the error occurs ina mUlti-statement line, the CONTINUE command re-executes the entire line. .

If a STOP occurst a CONTINUE command will execute the statement following the STOP statement, even iI- that statement is on the same line.

Note: Executing, an immediate instruction after a stop or error prevent you from using the CONTINUE command. An immediate executed, causes the line pOinter to be lost.

BASIC Rev B 115

-has occurred will instruction, when

COIrUUE

BASIC BlFElDCB MDDIL . 8.6 DBLErB Ccw=aftd

---~-~---~--~---~--~~8 1 DBLErB

2 DBLErB <raage) Where:

<range> ::=

Purpose:

<line number> <line number>

<line number>,<line number>

.1 I I I -·1 I

I I I I

The DELETE command allows. the user to remove a line or group of lines from the program.

ec-ent:

Format 1 of the DELETE command removes the current line from the program in memory.

Format 2 of the DELETE command removes all lines from the program in memory whose line numbers are included in the range specified.

The DELETE command cannot be used if the program in memory i's read protected (see LOAD command.).

The restrictions for first and last line numbers as described for LIST apply to the DELETE command; however, the DELETE command must have at least one operand.

Using the first example in Appendix G as the program in memory:

===================================================================================

Examples:

-DELETE 40 -DEL 15,45 -LIST

10 INPUT "RADIUS OF CIRCLE",R 50 END

Explanation:

Line 40 is removed from the program.

Lines 20 and 30 are removed from the program.

---~---~---~~

Incorrect Examples:

-DELETE 50,20

Invalid co~and syntax

Explanation:

Last line number must be greater than or equal to first line number.

===================================================================~===============

DBLBD -116- BJSl:C Bey B

CBAPDI 8: CCIIIIIDS

8.1 Down ec-and

(l1De teed)

---~--~---~---~~---~

Purpose:

The down command advances and displays the next line of source code.

Cc ent:

The down command cannot be used if the program in memory is read protected (see LOAD command).

When the down command is entered the current line pointer is adjusted one line

forward and the current line is displayed.

-Attempting to executed the down command when the current line -is at the last line of the program the message EOF: is displayed indi~ating that you are at the end of file.

BASIC ley B - 111·- DOIIII

BJSI:C IIFBIDCB HDDAL 8.8 BBLP C _ _ nd

~---~---~ . . D·' I

! .

1 BILP

---~---~---~----~-Purpose:

The HELP command displays the commands available to the operator in BASICe

When the HELP command 1s .executed the help message ot command names and general syntax is displayed on the screen, one page at a time.

============================================================================'=======

Example:

-HELP

AUTO [<start>[,<incr>ll· . BOTTOM

BREAK [AT <line> [AFTER <count>1l

BREAK ON <var> [CHANGE] [AFTER <count>]]

BREAK ON <var <relat> <value>]

===================================================================================

BBLP - Ji8 - BASIC Bey B

CIIlPDI 8:

CCIIIDDS

---~---I

1 DDIft [<1Ddent value>] I

I

~---~---~---Purpose:

The INDENT command provides an easy' and consistent method of performing ·program line indentation for documentation purposes.

ec..ent:

When the INDENT command is executed' the program currently in memory is modified by strippigg all current line 'indentation and performing new indentation according to a set of rules:

• Indent level initiall!: set to <indent value> or, when not specified, to the default value of 5.

• The statements· CASE, CEND, ELSE, IF END , REM, and THEN cause· the indent level to be adjusted -<indent value> before the statement.

• The statements CASE,' multiline DEF ELSE, FOR, REM, THEN, WHILE" and line label cause the indent level to be adjusted +<indent value>

after the statement or label.

• The statements CEND, FNEND, IFEND NEXT, and WEND cause the indent level to be adjusted -<indent value~ after the statement.

• The statements IF and SELECT cause the indent level to be adjusted +2*<indent value> after the statement.

• All other statements perform no adjustment on the indent level.

===================================================================================

Example:

-LIST 20 10

~8

REM This is a comment FOR 1=1 TO 10

PRINT I NEXT I SELECT A

500

6 CASE 1 RETURN

700 CASE 2 STOP

8 CEND

90 REM This is a subroutine 100 RETURN

.... INDENT -LIST

10 REM This is a comment 20 FOR 1=1 TO 10

30 PRINT I

~O NEXT I

50 SELECT A

60 CASE 1 RETURN

70 CASE 2 STOP

80 CEND

90 REM This is a subroutine 100 RETURN

===================================================================================

BASIC ley B - 119 - DDBft

BASIC DFBDllCE IIDOAL

The LENGTH command displays thirteen quantities:

• Length of source program in byteso

-Symools and numeric variable values.

String variable values.

No open subroutines . No open FOR/NEXT loops.

No open SELECT/CASE/CEND structures.

No open WHILE/WEND structures.

One breakpoint set.

Two I/O channels defined.

Load USR program named PRINT1

===========================~=======================================================

- 50 ... BASIC ley B

CIIAPrBB 8: CCIIIDDS 8.11 LIST Cc==and

---~---.

1 Lnrr