13. FILE NOT ACCESSABLE (x)
14. FILE STRliCTURE FULL-'KEEP' AND 'TEXT' TO RESTPUCTUPF.
15. AMBIGUOUS REOUEST - THE FILE IS UNNUMBEqED 16. POSITION NOT FOUND
17. STRING NOT FOUND 18. LINE DOES NOT EXIST
19. COMMAtW WILL NOT REPLACE OR INTERLEAVE LINES 20. LINE ZERO CANNOT BE ACCESSED
21. END-OF-FILE
TITLlE:
DESCRIPTION:
INSTRUCTIONS:
ACKINOWLEDGEMENTS:
DATA HANDLING (100)
CONTRIBUTED PROGRAM
BASIC
FILE MANIPULATION - CREATES, EDITS, LISTS, SORTS,
EMULATES G.E. MK II. EDITOR
36749 These programs attempt to facilitate working with an internal file on an HP Time Sharing system. The overall philosophy is that a person with the barest minimum knowledge should be able to add and delete records.
Later he could then learn to use the various options as the need arises.
Adding a record to a file is exactly like adding a line to a BASIC program. Deleting a line is also the same. In both cases line numbers are used to address program statements. The editor's primary addressing is also by line numbers. Internally a line number is mapped as a logical record onto a physical record displaced by an offset. This means that if 10 logical records per physical record are defined, with 50 physical records; 500 line numbers are available for data. (In this case each line could only have 50 characters because there are 512 characters per physical record). The user need only be concerned with line numbers.
These line numbers may be renumbered to allow inserting data when the lines become contiguous. Also, an interval value like 1.1 will cause every lOth line to be skipped, which is nice for a full file requiring programmed inserts, (when the renumber command is used).
The LIST command lists all active (non-nUll) records and their line numbers, starting at line number F and going to line number L (prompt is F, L?). These are the very basic tools and allow a person to control the content of a file much as he would control the content of a BASIC program.
A file by the name of DEL is required. This file is used to buffer records and needs to be 3 records long. Your working file must be opened, and in addition, a directory file must be opened. The directory file must be named the same name as your working file, followed by a "D"-e.g., WORK and WORKD. The directory file must be 20 blocks long.
HELP COMMAND
HOW IT WORKS: ENTER 'HELP' TO EDITOR PROMPT. Gives a list of commands and instructions for operating the EDITOR program.
(Continued on next page)
Denis Ferland
HP/Midwest Sales Region
INSTRUCTIONS: (Continued) FILE COMMAND
HOW IT WORKS: ENTER 'FILE' TO EDITOR PROMPT. Allows the editor to change the file it is operating on.
1. Enter next file to be operated on in response to 'FILE NAME'.
2. If file does not exist an error message will cause the program to abort.
3. If a new file is called it is automatically initialized by the Editor.
Physical records: Answer # of records used in open command. Number of logicals per physical: Answer # of records to be contained in 512 characters available in one physical record.
FIND COMMAND
HOW IT WORKS: ENTER 'FIND' TO EDITOR PROMPT. A particular record is located (or determined to be missing by means of a key given by an input String~ The length of the key is the same length as the input String. A combination linear hash and Table correction is used to arrive at the correct record number in the minimum number of file accesses.
CHANGE COMMAND
HOW IT WORKS: ENTER 'CHANGE' TO EDITOR PROMPT. Will search for occurrences of 'FROM' string and replace them with occurrences of 'TO' string.
Operation Options:
1. The answer 'YES' to the question 'verify?' will allow the user to over-ride each change before it is executed.
2. 'F, L?' is the request for line numbers to be effected by 'CHANGE'.
POSTFIX COMMAND
HOW IT WORKS: ENTER 'POST FIX' TO EDITOR PROMPT. Will add a given string to the end of a record.
Operation:
1. 'STRING' is information to be added to end of record.
2. 'F, L' is the request for line numbers to be effected by 'POSTFIX'.
PREFIX COMMAND
HOW IT WORKS: ENTER 'PRE FIX' TO EDITOR PROMPT. Will add a given string to front of a record.
Operation:
1. 'STRING' is information to be added to the front of record.
2. 'F, L' is the request for line numbers to be effected by 'PREFIX'.
LOCATE COMMAND
HOW TT WORKS: ENTER 'LOCATE' TO EDITOR PROMPT. Will sequentially scan records until an occurrence of a given String is found. It will print the record in which the string occurs at least once.
Operation:
1. 'STRING' is the string to be found.
2. 'F, L' requests the line numbers to be effecced by 'LOCATE'.
DELETE CHARACTER COMMAND
HOW IT WORKS: ENTER 'DELETE CHARACTER' TO EDITOR PROMPT. Will delete a given sequence of characters with a record.
Operation:
1. From character number, to character number requests definition of the in:erval of characters to be deleted.
2. 'F, ~ is the request for line numbers to be effected by 'DELETE'.
INSTRUCTIONS: (Continued) INSERT LINE
EDITOR, page 3
HOW IT WORKS: ENTER 'INSERT LINE' TO EDITOR PROMPT. A new record is inserted after the given line number. The contiguous line numbers are adjusted accordingly.
INSERT CHARACTER COMMAND
HOW IT WORKS: ENTER 'INSERT' TO EDITOR PROMPT. Will insert a given string ~iter the given
MAX' OF" PHYSICAL RECORDS?20 NUMBER OF" LOGICALS PER PHYSICAL?7 MAX STRING SIZE IS-72
1HELP
LEGAL COMMANDS ARE: LIS,LIST,LIST SORTED
F"ILE (TO CHANGE THE F"ILE YOU ARE WORJ<ING ON DELETE LINES, DELETE CHARACTERS
INSERT LINES. INSERT CHARACTERS LOCATE (J<EYWORD SEARCH>
F"IND (F"AST LOOJ<UP>
POSTF"I X, PREF"I X RENUMBER
GENERATE TEST F"ILE HELP