SED - File handling

SED  -  File Handling

Top  Previous  Next

 

Save record (Ctrl-X S or Ctrl-X Ctrl-S)

The current record is saved, overwriting the previous version (if any).

 

Write record (Ctrl-X W or Ctrl-X Ctrl-W)

A prompt is issued for the file and record names under which the data is to be saved. The file name may be prefixed by DICT to indicate that the dictionary portion is required.

 

After saving the data, the selected file and record names become current. A later use of the save record function would replace this record not the record that was specified when editing began.

 

The update lock is transferred to the new record by this function.

 

Import (Ctrl-X I)

A prompt is issued for the file and record names for the data to be imported. The data is then inserted at the current cursor position.

 

Export (Ctrl-X X)

The export function saves the contents of the region between the cursor and the mark to a file. A prompt is issued for the file and record names under which the data is to be saved. The file name may be prefixed by DICT to indicate that the dictionary portion is required.

 

Find record (Ctrl-X Ctrl-F)

The editor can handle multiple records simultaneously. The find record function prompts for file and record names and reads the record for editing. The file name defaults to that of the record in the current buffer. If the named record does not exist, a prompt is issued to confirm that it is to be created. Multiple records are of particular use when copying data between records.

 

The find record function will accept the record name on the same response line as the file name as an alternative to entering the file and record names in response to separate prompts. This is achieved by separating the file and record names by a single space. SED still attempts to open a file with a name corresponding to the complete prompt response first to allow for the unlikely situation of a file name which includes a space.

 

The find record function maintains a stack of the last 10 files referenced by this command. The up line and down line functions can be used to restore previous file names from the stack when the file name prompt is displayed.

 

List buffers (Ctrl-X Ctrl-B)

The list buffers function displays a list of all currently defined buffers, showing the buffer number, and its corresponding file and record names. It is of use when multiple records have been read. The colon normally following the buffer number is replaced by an asterisk if the buffer has been modified or a hyphen if it is a read-only buffer.

 

A marker is displayed to the left of the buffer number of the current buffer. This marker can be moved up and down using the up line and down line functions. Pressing return selects the marked buffer. The cancel function will revert to the previous buffer.

 

Next buffer (Esc-N)

When multiple records are in use, this function selects the next buffer as the current buffer for display and editing.

 

Previous buffer (Esc-P)

When multiple records are in use, this function selects the previous buffer as the current buffer for display and editing.

 

Goto buffer (Ctrl-X B)

This function selects the buffer identified by the repeat counter value.

 

Delete buffer (Ctrl-X K)

The current buffer is deleted, freeing it for use by other records. A confirmation prompt is displayed if the buffer has been modified.

 

List records (Ctrl-X D)

Displays a list of the records in a file allowing the user to explore the content of the file. The editor prompts for the file name which defaults to that of the record in the current buffer.

 

The file name may be followed by a selection template separated from the file name by a single space. If this template begins with the word LIKE or WITH the entire template is taken as a selection clause for the internally executed SELECT command. If the template does not begin with either of these words, it is assumed to be a pattern for matching with the SELECT statement LIKE clause. Thus a template of

PRT...

is equivalent to

WITH @ID LIKE PRT...

 

Single or double quotes may be used as required to ensure correct parsing of the template. Multiple conditions may be included exactly as in a SELECT statement. A template not starting with LIKE or WITH may not include both single and double quotes.

 

The list of records is displayed in a buffer which is tagged with a pseudo-record name of ­­Explore­­. If an explore list already exists for this file, the list is rebuilt by this function, thus showing any changes to the file content.

 

The normal editor functions may be used to move around this buffer but it cannot be updated. The return key or the dive function (Ctrl-X Ctrl-D) will cause the editor to read and display the record identified by the line of the explore list on which the cursor lies. If this record is already loaded into a buffer, the existing buffer is selected.

 

The kill line function executed in an explore buffer deletes the record named on the current line. A confirmation prompt is issued before the record is deleted. If this record is currently loaded into a buffer, the buffer is also deleted. A second confirmation prompt is issued to confirm this action.

 

Up to parent (Ctrl-X U)

Moves 'up' from the displayed record to an explore list for the file holding the record. If the explore list already exists, the list is not rebuilt by this function.

 

Used in an explore buffer, this function moves up to a display of all files in the VOC. Diving into a file from this list shows a list of records in the file. It does not dive into the VOC record itself.

 

Used in a value edit buffer, this function returns to the parent buffer, saving any changes into the main buffer.

 

Dive (Ctrl-X Ctrl-D)

When positioned on a $INCLUDE statement of a QMBasic program, this function loads the associated include record into a new buffer.

 

When not positioned on a $INCLUDE statement, this function enters edit value mode.