• Aucun résultat trouvé

The LIST Command

Dans le document User's THEOS/OASIS (Page 110-115)

The LIST command allows the listing of the contents of data files either on the terminal screen or printer. This command should be used only with sequential, indexed, keyed, or direct files. Trying to list other types of files will cause unpredictable results or, in the case of files that are read protected (see the RENAME tutorial), listing the file may not be possible. The type of file most often listed is the sequential file. As we will see in the tutorial-session on the EDIT command, the LIST command is most useful when editing a sequential file.

There is no privilege level associated with this command, but files can only be listed that belong to the currently logged account or the system account. For example, if you are logged onto an account called USERl, the contents of files cannot be listed that belong to an account called USER2 unless USERl and USER2 are synonymous.

The format of the LIST command is:

LIST FILENAME FILETYPE DRIVNAME (options

FILENAME is the name of the file to be listed. FILETYPE is the type of the file to be listed. D RIVN AME is the name of the drive where the file is locatt"a. The DRIVNAME does not have to be specified.

However, when the name of drive where the file is located is known, specifying the drive will reduce, by a few seconds, the time required to locate the file.

The use of wildcards is not permitted with this command. If an error message such as "Syntax error" appears on the screen after a command line has been entered, it is usually a result of leaving out either the FILENAME or FILETYPE.

110 THEOS User's Handbook

Option Function

HEADING Provides your file list with a heading. If this option is not specified, THEOS provides it as the default.

The heading includes the file name, file type, disk drive, disk label, current system time, date, and page number. When the list is sent to the screen, the length of the screen page is the attached length of the screen designated by ATTACH

NOHEAD Tells THEOS not to provide a page heading.

PAGE nn The listing of the file will not begin until the page number specified by nn is found.

PRINTERn The list is sent to the printer. n is the number of the printer to which you wish the listing sent.

Figure 4.24. The LIST command options

Default Options

The default options for this command are the HEADING option and the listing of the file automatically output to the screen.

USING THE LIST COMMAND

This command is most helpful for listing sequential files. For listing short files (files no longer than two screen pages) outputting the list to the screen may be adequate. When listing longer files, printing the list is more convenient because you may want to refer to it regularly.

The examples below assume that the files are owned by your account. Since these files are not now part of your system, do not attempt to actually type these examples. They are for illustrative purposes only.

Example 1:

>LIST ASSIST EXEC S·,<RETURN>

ASSIST.EXEC:HARDISK1

&CONTROL OFF -START

&CRT CLR

03/07/86 17:41 Page 1

&TYPE PLEASE TYPE THE OASIS COMMAND YOU WISH HELP ON OR [RET) TO LIST COMMANDS \

&READ &SEL

&CRT CLR HELP &SEL

&WAIT

&CRT CLR

&CRT 30,14

&TYPE MORE HELP? YIN \

&READ &SEL

&IF &SEL Y &GOTO -START

&IF &SEL N &CRT CLR

&IF &SEL (> Y &IF &SEL (> N &GOTO -START

&QUIT

&WAIT

Figure 4.25. Listing of ASSIST.EXEC output to screen

This example displays a listing of the sequential file called ASSIS-T.EXEC located on drive S on the terminal. All of the heading infor-mation is displayed on the screen.

Example 2:

LIST ASSIST EXEC S (PRINTER1 <RETURN>

112 THEOS User's Handbook

r-

ASSIST.EXEC:HAROISKI

"&CONTROL OFF -START

&CRT CLR

12/17/84 ~9:37 Page 1 ~

&TYPE PLEASE TYPE THE OASIS COMMAND YOU WISH HELP ON OR [RET] TO LIST COMMANDS'

&REAO &SEL

&CRT CLR HELP &5EL

&WAIT

&CRT CLR

&CRT 30.14

&TYPE MORE HELP? YIN \

&READ &SEL

&IF &5EL = Y &GOTO -START

&IF &5EL = N &CRT CLR

&QUIT

~AIT

Figure 4.26. Listing of ASSIST.EXEC output to printer

This example illustrates the use of the PRINTER option. The file listing shown on the screen in example one is printed on the printer.

Example 3:

LIST ASSIST EXEC S (NO HEAD <RETURN>

&CONTROL OFF

The file listing is output to the screen, but this time no heading is displayed.

Example 4:

LIST APOIMO.PDS (PRINTER <RETURN>

APOIMO.PD:TEST

-6573.68,-60,06/29/83,Paymnt on acct., ,0,0,0 -100,0,06/29/83" ,200,1,0

0,0,08/16/83,travel, ,0,0,0

-5565,0,09/06/83,test check"O,O,O -500,0,09/22/83,Computer parts"O,O,O

Figure 4.28. Listing of indexed file AROIMO.CM output to printer The preceding example illustrates the appearance of an indexed file listing when it is output to a printer. This file contains data that references pai~ invoices in an accounts payable program.

114 THEOS User's Handbook

SUMMARY

The LIST command provides the only method of listing the contents of THEOS files. Although most THEOS files can be listed, the listing of sequential files is performed most frequently. More detailed examples illustrating the use of the LIST command will be provided in the TEXTEDIT tutorial session.

Dans le document User's THEOS/OASIS (Page 110-115)