• Aucun résultat trouvé

Terminating a Session and Saving Your File

Dans le document ISIS-II USER'S GUIDE (Page 75-81)

To display from the beginning of a line to the location of the pointer:

*OT$$

To display the entire line no matter where the pointer is located within the line:

*OTT$$

In the preceding example, the "OT" displays from the beginning of the line to the pointer and the second "T" displays from the pointer to the end of the line.

To move the pointer to the beginning of a line and then display the line:

*OLT$$

To display the previous line and move the pointer to the beginning of that line:

*-1 L T$$ or just *-L T$$

To display your entire file but you don't know how many lines are in it but know it can't be more than 500:

*B500T$$

When the end of the file is reached the command stops.

Terminating a Session and Saving Your File

There are two commands to exit the Editor and return to ISIS-II. One command saves your work from the editing session on disk and the other doesn't.

E - Exit Command

The E command saves the entire contents of the file in memory on disk. If the file being edited is not completly read in from the disk, the E command saves the con-tents of the file in memory and then reads the remainder of the file from the disk and immediately writes it back to the disk. When the entire file is saved, the Editor returns control to ISIS-II.

The format of the E command is:

E$$

where:

E is the command code.

E Command Example. To save,the contents of the text file on disk and exit the Editor:

*E$$

Q - Quit Command

The Q command causes an exit from the Editor and returns control to ISIS-II without saving the data in memory.

The format of the Q command is:

Q$$

where:

Q is the command code.

Q Command Example. To exit the Editor and return to ISIS-II:

*Q$$

W - Write Command

The W command takes n lines from the beginning of the memory buffer and writes them onto the disk. The lines that are output are deleted from memory. This prevents the duplication of these lines when an E command is issued.

A common usage of the W command is to store part of a very large program while still entering the end portions. Once data has been written out to disk using the W command, it can only be brought back into memory by issuing an EXIT command and then an EDIT command for the file.

The format of the W command is:

[n]W$$

where:

n specifies the number of lines to be output and deleted from memory. If n exceeds the number of lines in the file, the entire file is output. If n is omitted, 1 is assumed.

W is the command code.

W Command Example. To save the first 25 lines of the file in memory on disk:

* 25W$$

Reading Data from Disk

The Editor provides a single command to read data from disk into memory.

A - Append Command

The A command reads a maximum of 50 lines of text from disk into memory. The text is appended to the bottom of the data already in memory (data that was read in with the A command or entered via the Editor commands).

The A command reads 50 lines of text or until:

• The end of the file is reached.

• An end-of-file character (ControI/Z) is read. The ControllZ is not read into memory.

• The memory assigned to the Editor is full.

• A form feed character (ControIlL) is read. The ControllL is read into memory.

If you have a large file to read into memory, you can issue repeated A comands. An iterative parameter is ignored for the A command.

The format of the A command is:

A$$

where:

A is the command code.

A Command Examples. To read 50 lines of text from disk into memory:

*A$$

To read 500 lines of text from disk into memory:

* AAAAAAAAAA$$

Please note that the command "lOa" will only read 50 lines of text. The iterative parameter is ignored. (See the section "Command String Iterations" later in this chapter for an alternative way to specify multiple A commands.)

Determining Memory Space Available

The Editor has a command to determine how much memory space is still available for text entry.

M - Memory Command

The M command computes and displays on the system Console output device, the number of bytes of memory still available. The information is supplied in the following message:

nnnn-CHARACTER(S) AVAILABLE IN WORKSPACE

where nnnn is a decimal integer.

If you are entering a large amount of data, you can check on the amount of storage available and, if it runs short, save the first part of the file on diskette with the W command.

The format of the M command is:

M$$

where:

M is the command code.

M Command Examples. To check on the amount of storage available:

*M$$

Command String Iterations

You can repeat a command string or a single command any number of times by enclosing the command string in angle brackets

« »,

preceded by a number that specifies the number of times the command string is to be performed.

A typical use of this capability is to meet the need to change a character string that exists throughout the file. For example, if you have a program that uses a data field named "Xl" and you want to change all occurances of the name to something more meaningful to anyone else reading the code. To change "Xl" to "LOOPCNT"

through out the file you can use the following:

*B100<SXl$LOOPCNT$>$$

In this example, note that a B command was used first to move the pointer to the top of the file. Also note that an ESC or AL T MODE character was used to separate LOOPCNT from the final angle bracket. This prevents the Editor from using the angle bracket as part of LOOPCNT.

In the description of the A command it was pointed out that an iterative parameter cannot be used with A command. In an example there, we used a string of 10 A com-mands to read 500 lines from paper tape. Using this facility, the 10 A comcom-mands can be entered as follows:

*10<A>$$

This is equivalent to:

* AAAAAAAAAA$$

while:

*10A$$

is only equivalent to:

*A$$

Command string iterations can be nested. For example, the command:

*100<3C2>5CD<L>$$

will go through a 100 line file. On each line it will advance the pointer 3 characters and then, twice, it will advance five more characters and delete a character. The inner string advances the pointer five characters and deletes the sixth character. The outer string advances the pointer three characters before executing the inner com-mand string and then advances the pointer to the next line.

Iteration command strings can be nested eight deep. If more than eight strings are nested, the following error message is issued and the command is not executed:

ITERATION STACK FAULT

*BREAK*

WORKING WITH

Dans le document ISIS-II USER'S GUIDE (Page 75-81)