📄 ug_ch12.htm
字号:
edit <i>{</i>own | prev | next<i>}</i> <i>setname</i>edit dbaedit optedit <i>{</i>dchain | nextslot<i>}</i>edit hex</font></pre><h3><a name="RecordTypes" id="RecordTypes"></a>12.5.1 EditingRecord Types</h3><p><font size="2">The <b>edit type</b> command allows you to alterthe record type identification number. The current type is printed(both numerically and symbolically). The new record type may beentered as a number or name. All subsequent displays andinterpretations of the current record are based on the new type.The record type must be one that is included in the current file,or the display command is unable to display the record.</font></p><p>The record type may contain an embedded record lock bit (RLB).The bit will show in the numeric display as a 40 in the high-orderbyte of the record type. Textually, the notation "<b>- RLB</b>"will appear following the name of the record type. The RLB may becleared by entering a new (or the same) record type. It may be setby entering 40 as the high-order byte of the type.</p><h3><a name="Pointers" id="Pointers"></a>12.5.2 Editing Set andMember Pointers</h3><p><font size="2">Individual parts of the set and member pointersmay be edited by naming the part (for example, <b>count</b> or<b>next</b>) and set name, <i>setname</i>.</font></p><p>The current value is displayed. The new value may be entered inthe standard database address format as shown in the followingexample:</p><pre><font color="#0000FF">dbedit> edit first author_listCurrent value is [1:15]New value? 1:18dbedit> </font></pre><p><font size="2">If no change is desired, simply press<Enter>.</font></p><h3><a name="Address" id="Address"></a>12.5.3 Editing the DatabaseAddress</h3><p><font size="2">The database address portion of a record (bytes2-5) may be edited using the <b>edit dba</b> command. The existingdatabase address value is printed. The new value may be entered instandard database address format.</font></p><p>If the current record slot is a deleted record, the databaseaddress portion contains the slot number of the next slot on thedelete chain. Because this is not a database address but a slotnumber, edits to delete chain entries should be specified with filenumber 0 (for example, <b>0:25</b>).</p><h3><a name="Optional" id="Optional"></a>12.5.4 Editing theOptional Key Bits</h3><p><font size="2">When an optional key is stored, a bit is set inthe data record to represent its presence in the key file. Thesebits may be changed using the <b>edit opt</b> edit command. The bitmap (in hexadecimal) is displayed together with the names of alloptional keys in the record type. Beside each key name is anotation indicating whether the key is stored<br>(- STORED) or not (- NOT STORED):</font></p><pre><font color="#0000FF">dbedit> edit opt40 PUBLISHER - NOT STOREDINFO_TYPE - STOREDNew value?publisher,info_type</font></pre><p><font size="2">The new value may be entered as a bit map (inhexadecimal), or as a list of the key names (comma separated) thatare to be set. Note that any changes performed here will requirethe use of <b>keybuild</b> in order to make the data filesconsistent with the key files. In the above example, both the<b>publisher</b> and <b>info_type</b> optional key flags will beset.</font></p><h3><a name="PageZero" id="PageZero"></a>12.5.5 Editing PageZero</h3><p><font size="2">The first two long integers in page zero of thecurrent file (the file containing the current record) may be editedusing the <b>edit dchain</b> and <b>edit nextslot</b> commands.Both of these commands display the current value and prompt for thenew one. They are written to the file immediately. Note that thevalues are slot numbers, not database addresses, and do not takefile numbers.</font></p><h3><a name="Hexadecimal" id="Hexadecimal"></a>12.5.6 GeneralHexadecimal Editing</h3><p><font size="2">To allow the operator to make changes to thedatabase not covered in other commands, <b>dbedit</b> provides theability to edit a file as a stream of hexadecimal bytes. In thismode you can:</font></p><p><font face="Symbol" size="2">·</font> <font size="2">Display any number of lines in both hexadecimal andASCII<br></font><font face="Symbol" size="2">·</font><font size="2">Move to any byte position in thefile<br></font><font face="Symbol" size="2">·</font><font size="2">Search forward and backward for apattern<br></font><font face="Symbol" size="2">·</font><font size="2">Replace characters on a byte-for-byte basis ineither hexadecimal or ASCII</font></p><p>The hexadecimal editing mode is initiated by entering the<b>edit hex</b> command. When in this mode, the prompt is changedto:</p><pre><font color="#0000FF">hex> </font></pre><p><font size="2">To exit the hexadecimal edit mode, enter thecommand:</font></p><pre><font color="#0000FF">hex> enddbedit> </font></pre><p><font size="2">When hexadecimal edit mode is entered, changesthat were made to the current record are written to the database,and the current position in the file becomes the file address ofthe current record. The changes made in hexadecimal edit mode arewritten to the database by the <b>end</b> command. To cancel thechanges and return to <b>dbedit</b> mode, enter<b>cancel</b>.</font></p><p>After ending hexadecimal edit mode, the current record isreturned to its original slot, unless the current file positionlies within a different record, in which case <b>dbedit</b> willprompt you to see if your current record should be changed to thisnew position, or if you want to return to the original currentrecord.</p><p>Table 12-1 describes the commands that can be used in hex editmode.</p><p align="center"><b>Table 12-1. Hex Mode Commands</b></p><table border="1" cellspacing="1" cellpadding="7" width="542"><tr><td width="21%" valign="top"><p><b><font size="2">Command</font></b></p></td><td width="79%" valign="top"><p><b><font size="2">Definition</font></b></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">print <i>N</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Print <b><i>N</i></b> lines (both hexadecimal andASCII representation). If <b><i>N</i></b> is absent, print oneline.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">+<i>N</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Move forward <b><i>N</i></b> characters. If<b><i>N</i></b> is absent, move one character.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">-<i>N</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Move backward <b><i>N</i></b> characters. If<b><i>N</i></b> is absent, move one character.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">=<i>N</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Move to address <b><i>N</i></b>, where<b><i>N</i></b> is a hexadecimal number between 0 andFFFFFFFF.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">><i>N</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Move forward <b><i>N</i></b> lines. If<b><i>N</i></b> is absent, move one line.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2"><<i>N</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Move backward <b><i>N</i></b> lines. If<b><i>N</i></b> is absent, move one line.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">>><i>STRING</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Search forward for <b><i>STRING</i></b>.<b><i>STRING</i></b> may be either an ASCII string within quotes("string"), or hexadecimal bytes (73 74 72 69 6E 67).</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2"><<<i>STRING</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Search backward for<b><i>STRING</i></b>.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">write <i>STRING</i></font></b></p></td><td width="79%" valign="top"><p><font size="2">Write <b><i>STRING</i></b> into currentposition.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">cancel</font></b></p></td><td width="79%" valign="top"><p><font size="2">Erase all edits since entering hex editmode.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">end</font></b></p></td><td width="79%" valign="top"><p><font size="2">End hex edit mode.</font></p></td></tr><tr><td width="21%" valign="top"><p><b><font size="2">help</font></b></p></td><td width="79%" valign="top"><p><font size="2">Print a short list of these commands. Alias is<b>?</b>.</font></p></td></tr></table><h2><a name="Diagnostics" id="Diagnostics"></a>12.6Diagnostics</h2><p><font size="2">Illegal changes to a database will be screened,whenever possible, before they are made. For example, if a recordtype is changed to a type not contained in the current file, thechange will not be allowed (except in hexadecimal editmode).</font></p><p>Since <b>dbedit</b> allows updates to set instances, it will beimportant to know if a change has corrected a problem in the chainof database addresses forming the set instance. For this purpose,the <b>verify</b> command can be used to traverse an entire setinstance to check owner, previous, next, first, and last pointerconsistency. It will perform a check similar to that done by the<b>dbcheck</b> utility. The name of the set must be identified withthe follopwing command:</p><pre><font color="#0000FF">verify <i>setname</i></font></pre><h2><a name="Miscellaneous" id="Miscellaneous"></a>12.7Miscellaneous</h2><p><font size="2">The <b>exit</b> command will end your<b>dbedit</b> session. If the current record was modified, it iswritten to the database before exiting.</font></p><p>The <b>reread</b> command causes the current record to be readfrom the database. This has the effect of canceling any updatesmade to the record in the buffer.</p><p>To eliminate the titles in the <b>display</b> output, the<b>notitles</b> command can be issued. The resulting output isshorter, but readable to the experienced operator. By default,titles will be printed. The <b>titles</b> command can be used tocancel the <b>notitles</b> command.</p><p>To eliminate the data fields in the <b>display</b> output, the<b>nofields</b> command can be issued. The resulting output willonly contain the overhead information (record type, <b>DB_ADDR</b>,set pointers, etc.). This can be useful when the data in the recordis correct, but there are problems with the overhead information.By default, fields will be printed. The <b>fields</b> command maybe used to cancel the <b>nofields</b> command.</p><p>All database addresses and counts will be displayed in decimalformat unless otherwise requested. To change the display format,the <b>base</b> command may be issued.</p><pre><font color="#0000FF">base<i> {</i>10 | 16<i>}</i></font></pre><p><font size="2">Only base 10 (decimal) and base 16 (hexadecimal)are recognized.</font></p><p>Any editor command or keyword may be abbreviated to anon-ambiguous set of characters. If more than the required numberof characters is entered as a command, they must correctly spellthe intended command. If an ambiguous set of characters is entered,an error message is displayed stating that more characters must beentered.</p><h2><a name="Summary" id="Summary"></a>12.8 Command Summary</h2><p><font size="2">A syntax summary for each of the <b>dbedit</b>commands is shown in the table below.</font></p><pre><font color="#0000FF">base <i>{</i>10 | 16<i>}</i>display <i>[</i>type | dba | ts | opt<i>]</i>display <i>{</i>set<i> [setname]</i> | mem<i> [setname]</i> | fld<i> [fldname]}</i>edit typeedit <i>{</i>first | last | count<i>}</i> <i>setname</i>edit <i>{</i>own | prev | next<i>}</i> <i>setname</i>edit <i>{</i>dba | opt | dchain | nextslot<i>}</i>edit hexexitgoto<i> {dba</i> | nextrec | prevrec <i>}</i>goto<i> {</i>first | last |<i> </i>own | prev | next<i>} setname</i>goto <i>{</i>file<i> {filenum</i> | <i>filename}}</i>help | ? nofieldsnotitlesrereadshow<i> {</i>field<i> [fieldname]</i> | file<i> [filename]</i> | key <i>[keyname]}</i>show<i> {</i>record <i>[recordname]</i> | set <i>[setname]}</i>fieldstitlesverify <i>setname</i></font></pre><p><a href="UG_Ch13.htm">Next Page</a></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -