LIST
This article is a stub. You can help improve Basic Programming Wiki Complete by expanding it.

LIST - list the game code in memory.

Syntax

LIST [line number(s)]

Description

LIST is an outdated BASIC command. It was used during the days of line editors when BASIC game code was stored in memory one line at a time and there was no graphical interface, so you had to use text commands somewhat (but not exactly) like DOS. LIST was one such text command built right into BASIC.

When you type LIST, the screen editor would spit out all the lines it has in memory. If there were too many lines, the code listing would scroll off-screen quickly, not allowing you to examine your code. To examine specific lines in your code, you could include the line number of the line(s) you wanted to examine.

Examples

LISTing the Entire Game Code

If you type in list, the entire game code will be displayed.

LIST

LISTing Specific Lines

You can list only the specific lines of code by including them after LIST. The first example gives an example of listing one line only.

REM list line 30
LIST 30

Listing a range of lines requires you to enter the starting line and the ending line. Depending on which version of BASIC you are using, this can require either a dash or TO. Below are examples of both.

REM list lines 30 to 60 with dash
LIST 30 - 60
REM with TO
LIST 30 TO 60

LISTing While Executing

Strangely enough, like NEW and RUN, you could use LIST inside an actual program while it is running.

PRINT "This is a bit strange."
LIST

The output of the odd program when run would be :

This is a bit strange.
PRINT "This is a bit strange."
LIST

First, PRINT is executed, which displays This is a bit strange. on the screen. Then LIST is executed, causing the contents of the program to be displayed.

Related Pages

Backlinks

These pages link back to this page.

page tags: command outdated
page_revision: 4, last_edited: 1207774771|%e %b %Y, %H:%M %Z (%O ago)