• Keine Ergebnisse gefunden

INSERTING DATA: EDITOB

Im Dokument The Picl(System (Seite 111-114)

TYPE II VERB The type II verbs

1 AAAA 2 BBBB

4.8 INSERTING DATA: EDITOB

The Insert command is used to insert one new line. The Merge command is : used to insert one or more lines by merging lines from the same item, or:

: from another item in the same file, or another item in a different file.

4.8.1 "I" - INSERT COMMAND EDITOB FOBMAT:

I data

The user enters an "I", followed by one blank, followed by the data to be inserted. The specified data will be inserted as a new line after the current line. Note that the data to be inserted must be separated from the "I" by only one blank; all other blanks will be considered as part of the line to be inserted. The line continuation character (control-shift 0) cannot be used to continue data beyond one physical line.

The Insert command is most convenient for either inserting only one line of data (rather than using the Input command), or for INSERTING A NULL LINE; the latter is done by entering "I" and one space, followed by a carriage-return. One may also insert a string of Attribute marks to generate a string of null lines. This feature is particuarly useful when entering Dictionary items, which use null lines within their structure.

4.8.2 "ME" - MERGE COMMAND FROM THE SAME FILE FOBMAT:

ME{n)/item-id/{m)

This command causes n lines (starting from line number m) of the item whose item-id specified by litem-idl to be merged (inserted) into the item being edited. The lines will be inserted following the current line. The item specified by litem-idl must be in the same file as the item being edited. A value of one will be assumed for both nand m if either or both are omitted. If litem-idl is null (II), lines will be merged from the item being edited itself, as it stands in the current buffer, thus duplicating the specified lines in the item.

---The user should note that if the item from which lines are to be merged is not on file, the message "NOT ON FILE" will be printed.

CHAPTER 4 - EDITOR Copyright (c) 1985 PICK SYSTEMS PAGE 98

4.8.3 MERGE COMMAND: PROM OTHER PILES

The extended synt&x requlres the use of the delimlters "(" &nd ")" ln pl&ce of the "I" delimlter used &bove. They thus become reserved when uslng the merge comm&nd ln the sense th&t the colon "," ls reserved when uslng the loo&te, repl&oe, &nd delete oomm&nds. In thls o&se there ls the further peouli&rlty th&t "(" &nd ")" &re not the s&me ch&r&cter, where&s

&ny oh&r&oter m&y norm&lly be used &S & dellmlter, so long &S &11 the dellmlters ln & p&rtloul&r strlng &re ldentlo&l.

FORMAT:

HE{n} ({DICT} [PILENAME} (ITEMNAME}) {m}

The use of DICT ls conventlon&l. It me&ns the s&me thlng here &S ls does

&t TCL ln the reference to flIes, &nd ln the COPY processor. If there ls no item-id specified, then the processor def&ults to the ltem-id of the ltem being edited &t the moment. This is useful lf one wishes to get &

oopy of &n item lnto & test file &nd edlt lt qulokly, or if one wlshes to

&ssure th&t the ltem wl11 not be flIed In&dvertently over the old copy.

Comblned with the prestore comm&nd structure &nd the glob&l repl&ce command, some very powerful things oan be done very quickly and easily.

4.8.4 MERGE COMMAND DEFAULTS

There &re oert&ln other def&ults whlch &pply to the merge comm&nd, &nd whlch &re o&rrled over lnto this extended form whlch wl11 be noted below

&s & remlnder.

HE{n}({DICT} [FILENAME] {ITEMNAME}

This form does the s&me thing &S &bove, except th&t the st&rting line number def&ults to line 1 in the merge souroe ltem.

ME({DICT} [FILENAME] {ITEMNAME}){m}

This does the s&me thing &s &bove, except th&t st&rting-llne-number ls the only line whloh is merged into the destin&tlon ltem. As such, the 11ne m&y then be modifled uslng the repl&oe oomm&nd, &s noted &bove.

HE({DICT} [FILENAME] {ITEMNAME}

This slmply returns the flrst 11ne of the merge source ltem. Note th&t the tr&illng rlght p&renthesls ls optlon&l lf the st&rtlng line number def&ults to the flrst 11ne of the source.

4.8.6 MINIMAL MERGE

Obviously, these def&ults &11 &pply to the norm&l merge st&tement, le&dlng to the mlnim&l form 'HE/', whioh Simply inserts the flrst 11ne of the ltem ourrently being edited into the ourrent loo&tlon ln the item, which is useful if you wish to put & given line in sever&l different pl&ces in &n item.

CHAPTER 4 - EDITOR Copyright (0) 1986 PICK SYSTEMS PAGE 99

EXAMPLES:

Im Dokument The Picl(System (Seite 111-114)