LIST

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
LIST [file$]
LIST ALL [file$]
LIST FILES [fspec$] [, sort]
LIST COMMANDS
LIST FUNCTIONS
LIST PAGES
LIST PROFILE [CSV]

Description:

LIST [file$]
LIST ALL [file$]
List a program on the serial console.
LIST on its own will list the program with a pause at every screen full.
LIST ALL will list the program without pauses. This is useful if you wish to transfer the program in the Maximite to a terminal emulator on a PC that has the ability to capture its input stream to a file.
In most cases the filename 'file$' is required however if EDIT file$ or RUN file$ has been used previously the "current program name" will have been set and in that case LIST will default to using that filename.
Devices without a file system do not accept 'file$' and will LIST the current loaded file.

LIST FILES [fspec$] [, sort] CMM2 only
This replaces the FILES command used on other devices.
Lists files in the current directory on the SD card.
'fspec$' (if specified) can contain search wildcards. Question marks (?) will match any character and an asterisk (*) will match any number of characters.
If omitted, all files will be listed.
For example:
* Find all entries
*.TXT Find all entries with an extension of TXT
E*.* Find all entries starting with E
X?X.* Find all three letter file names starting and ending with X
‘sort’ specifies the sort order as follows:
size by ascending size
time by ascending time/date
name by file name (default if not specified)
type by file extension

LIST COMMANDS
LIST FUNCTIONS
CMM2, Arrmites, Picromite only
Lists all valid commands or functions

LIST PAGES
CMM2 only
Lists the start address, width, height, and size of all the video pages for the current mode
In addition it shows whether for specific modes lines are duplicated in order to support the video output format.

LIST PROFILE [CSV]
CMM2 only
If OPTION PROFILING ON is set, program profiling is turned on.
This is a permanent option but it defaults to OFF whenever new firmware is loaded. 
With profiling on you will see a performance impact of about 5% caused by the profiling data collection which happens at the MMBasic statement level. In addition you will see a reduction in available variable RAM of 512KB. 
Note that profiling and OPTION RAM are mutually incompatible.
With profiling enabled you can run your programs as usual and you should see no change in behaviour other than as mentioned above. 
You can see the way the program has run using the commands LIST PROFILE and LIST PROFILE CSV

There are 5 comma-separated fields in the output
The first field is the number of times a given statement has been run 
The second field is the average time in Microseconds taken to execute the statement 
The third field is the crunched statement as stored in memory. This is quoted to make it easier to load into excel etc. 
The fourth field is the filename in which the statement appears. This is blank if the statement is in the main program, otherwise it gives the filename of the include file in which the statement is to be found 
The fifth and final field gives the line number of the statement in the source file.
When LIST PROFILE CSV is used a file is created in the same directory as the main program with the .BAS extension replaced with .CSV
LIST PROFILE can only be used at the command line 
LIST PROFILE CSV can be used in a program allowing you to create and rename multiple files while a program is running if required

A program can test if OPTION PROFILING is enabled using
MM.INFO$(OPTION PROFILING)
This returns a string "On" or "Off"

 

Last edited: 23 January, 2021