• Aucun résultat trouvé

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

2 LIST <ruse>

1 Lnrr

2 LIST

<ruse>

<line

Duaber>

II <carriage return>

Where:

<range> ::= <line number>

<line number> -<line number>

<line number>,<line number>

See also: Down, LPLIST, LPXREF, and XREF commands

Purpose:

The.LIST command allows you to display a line, or group of lines, of the program.

·ec..ent:

I I I 1

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

Format 1 of the LIST command will list the entire pro.gram.

Format 2 of the LIST command with one line number will list only that line, if it exists.

/

When a program is in memory you may list a line by entering its line number (format 3), "followed by' a carriage return. This not only causes the specified line to be

·displayed but assigns that line number to an internal line displal pOinter.

Entering a line feed character causes the line display pOinter to be advanced to the next line and causes that line to be displayed. This provides an easy means of stepping through the display of a program. Additionally, the line display pOinter is affected by an error during execution. When an error is detected and a message displayed on the console, you need only enter a carriage return to cause the error

line to be displayed. - . .

A carriage return only entry (format'4) will act in one of two ways: when it is the first entry of the carriage return the current line will be displayed; subsequent entries of a carriage return only will cause the internal line display pOinter to be incremented causing the next program line to be displayed, acting like a line feed entry.

Format 2 of the LIST command with two line numbers will list all lines within the range of the operands, inclusive. The beginning and ending line numbers need not be line numbers that exist in the program. The last line number must be greater than or equal to the first line number.

When more lines are specified to be displayed than will fit on the console at one time and the console screen wait is enabled (see System Control Keys in the OASIS -srstem Reference Manual), BASIC will display one page of the program, display a c rcumtlex (") at the lower left Side of the. page and wait for the operator to respond. A . response of any character will cause BASIC to display the next page of the program, if included in the line number range. The Program Cancel-key will cause the listing to be terminated immediately.

BASIC Bev B - 51 - LIST

BJ8IC IBPJ5IlI8CB IlDUAL

- : .

=======================================-===================================.=========

Examples: Explanation:

-LIST Entire ~rogram 1s listed on terminal.

10 INPUT "RADIUS OF CIRCLE",R

20 . PRINT "DIAMETER

="

ii-R

30 ~ PRINT "AREA ="·PI*H 2

~O PRINT "CIRCUMFERENCE =";2*PI*R .

50 END .

-LIST 20 Line 20 is listed.

20 PRINT "DIAMETER =";2*R

-LIST 0 15 Lines 0 through 15, inclusive, are listed.

10 iNPUT "RADIUS OFCIRCLE",R

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

Incorrect Examples:

-LIST 15 -LIST 20,10

Explanation:

Since there is no line 15 nothing will be listed.

Last line number must be greater than or

·equal to first line number. .

======================================================.=============================

LIST - 52 - B.lSIC Bey B

CB.IPI'BIl 8: CCIIWIDS

8.12 LOAD Cc=='nd

---~-~-~~-::::~---j Where:.

<program name>::= [<file name>][.<file type>][:<file disk>]

<file type> ::= BASIC . syntax analysis is performed.

When no program 4isk is specified the search for the program includes all attached

The program named TEST.BASICOBJ:S or TEST.BASIC:S will be located and ioaded

-BASXC IBFBIBICB IIDU.IL 8.13 LOCATE Ccwpencl

-~~-~--~---~~----~----~~-~---~---~~7.

1 LOCAD

~'LOCl!B (striDs>

3' LOCATE (str1Dg> <ruge>

Where:

(string) ::= <delimited string>

<range> ::= <line number> .

(line number> <line number>

(line number>,<line number>

I

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

Purpose:

The LOCATE command allows you to quickly find a line of the program that contains a specified sequence of characters.

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

The LOCATE command searches the program in the specified range of line numbers for the sequence of characters specified.

"

A LOCATE command with no arguments (format 1) will cause a LOCATE to be performed using the string specified in the last LOCATE or CHANGE, from the current line to

the end of the program 0 . .

Format 2 ot the LOCATE command causes the program to be searched from the line after the current line to the end of the .program.

Format 3 of the LOCATE command with onl! one line number specified causes· the program to be searched from the line specified to the end of the program.

Format 3 of the LOCATE command with two line numbers specified causes the program to be searched only within the range indicated.

If the sequence of characters is found the line containing them will be displayed.

and the current line pOinter will be positioned at that line. .

If the sequence of characters is not found nothing will be displayed and the current l1ne pointer will not be changed.

The search is performed independent of the case mode of the characters in the program.

====================.===============================================================

Example:

0010 FOR I=1 TO 20

0020 PRINT "Now is the time for all good men to come to the aid of"

0030 PRINT "country."

0040 NEXT I

-LOCATE

"y"

10 #0 0030 PRINT "country."

-LOCATE ITI ' 0040 NEXT I

-LOCATE III 10 40 0010 FOR I=1 TO 20 -LOCATE

0020 PRINT "Now is the time for all good ~en to come to the aid of"

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

LOCArB BASIC Bey B

CIIlPDI· 8: CCIIIDDS

. .

---~---~-~

1 LPLIST 2 LP<D>LISr

Where:

<n> ::= 1

2

n

See also: Down, and LIST commands

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

The LPLIST command allows the user to list the current program on the list device

--(usually the line printer).

ec..ent:

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

The LPLIST command functions identically to the LIST command except the output is placed on the listing device (PRINTER1) instead of the console and no line number range is allowed.

The alternate form of the-command (LP<n>LIST) specifies that one of the alternate listing devices is to be used (PRINTER1, PRINTER2, PRINTER3, or PRJ;NTER4), if

attached. '

BASJ:C Rey B - 55 - LPLIST

· )

BASIC· 'BBFBBBICB HD1JAL

8.15 LPDBF Cc==pncJ

1 LPDBF

Documents relatifs