ug_ch8.htm
来自「db.* (pronounced dee-be star) is an adva」· HTM 代码 · 共 1,833 行 · 第 1/5 页
HTM
1,833 行
<p>Pages<br>Sets the number of <b>ida</b>/<b><i>db.*</i></b> virtual memorydatabase pages.</p><p>Max_files<br>Sets the maximum number of database files that<b>ida</b>/<b><i>db.*</i></b> can have open at one time. Thisnumber should not be greater than the operating system limit, lessthree.</p><p>Logging<br>Toggles the transaction logging option. The screen will indicatewhether transaction logging is on (enabled) or off (disabled).</p><p>Chain<br>Controls the use of the delete chain for storing newly createdrecords. The display will show whether delete chain usage is on(enabled) or off (disabled).</p><h4>Quit command</h4><p><font size="2">Closes any opened database and ends the<b>ida</b> session. The environment variables DBDPATH and DBFPATHare restored to their initial values.</font></p><h2><a name="Entering" id="Entering"></a>8.3 Entering and ModifyingRecords</h2><p><font size="2">To edit or modify a database record, you use the<b>Display/Edit</b> <b>Record</b> submenu. Section 8.3.1 providesinformation about the commands on the <b>Display/Edit Record</b>submenu. Section 8.3.2 gives instructions for editing a data fieldand section 8.3.3 provides information about <b>ida</b>'s editingmodes and describes <b>ida</b>'s field editing commands.</font></p><h3><a name="AccessingDisplay" id="AccessingDisplay"></a>8.3.1Accessing the Display/Edit Record Submenu</h3><p><font size="2">To access an existing record with the<b>Display/Edit</b> submenu:</font></p><ul><li>Open the database you want.</li><li>Access the <b>Database Access Commands</b> and <b>Record</b>submenus.</li><li>Select a record from the database. You may use the<b>Keyscan</b>, <b>Get</b>, or <b>Recscan</b> options to select arecord. The record will be made the <i>current record</i>.</li><li>From the <b>Record Manipulation Functions</b> submenu (Figure8-4), select <b>Modify</b> to display the <b>Display/EditRecord</b> submenu.</li></ul><p>When the <b>Display/Edit Record</b> submenu is accessed, thecurrent record is displayed. Header information identifies the nameof the record, its length in bytes, the total number of data fieldsthat can be edited, the current page number, and total pages ofdata fields for the record.</p><p>Following the header is the first page of fields. The name ofthe data field appears on the left, its contents appear on theright. An example display is shown in Figure 8-7 below.</p><hr><pre><font color="#0000FF"><b>Display/Edit Record</b>Edit Init Next Prev Write Store_key Delete_key Owner Connect X_ExitEdit record<br>RECORD: INFO SIZE: 220 TOTAL FIELDS: 5 PAGE 1 OF 1<br>ID_CODE >sw001<INFO_TITLE >Software Reliability Principles & Practices<PUBLISHER >Wiley-Interscience<PUB_DATE >1976<INFO_TYPE >0<</font><font size="2"></font></pre><hr><p align="center"><b>Fig. 8-7. An Example Display/Edit RecordScreen</b></p><p>To create a new record with the <b>Display/Edit</b> submenu:</p><ul><li>Open the database you want.</li><li>Access the <b>Database Access Commands</b> and <b>Record</b>submenus.</li><li>Select the <b>Enter</b> submenu and select a record type fromthe list.</li><li>The <b>Display/Edit</b> submenu will show the recordinformation (as in Figure 8-7) with empty field contents.</li></ul><p>A field can be edited if it is not the sub-field of a<b>struct</b>. Select the <b>Edit</b> submenu command to changeindividual field contents.</p><h3><a name="UsingDisplay" id="UsingDisplay"></a>8.3.2 Using theDisplay/Edit Record Submenu Commands</h3><p><font size="2">Figure 8-8 shows the <b>Display/Edit Record</b>submenu commands.</font></p><hr><pre><b><font color="#0000FF">Display/Edit Record</font>Edit Init Next Prev Write Store_key Delete_key Owner Connect X_exit</b></pre><hr><p align="center"><font size="2"><b>Fig. 8-8. The Display/EditRecord Submenu</b></font></p><p>The first line is the menu title, and the second line lists themenu commands. This section describes each of these commands.</p><h4>Edit command</h4><p><font size="2">Selecting this command invokes field-levelediting of the displayed record. The field edit commands are listedin Table 8-2. The first field is highlighted and displayed in thedata field edit area. Field editing is initially entered in Commandmode. For information about <b>ida</b> editing modes, see section8.3.4.</font></p><h4>Init command</h4><p><font size="2">Use this command to initialize a new record.Selecting this command clears the displayed record and enters fieldediting (see section 8.3.4) in Insert mode.</font></p><h4>Next command</h4><p><font size="2">If the displayed record type consists of moredata fields than can be shown on one screen, this command can beused to display the next page of fields. Note that when enteringdata, each page of data fields must be entered before the record isstored. Use the <b>Next</b> command to access each page.</font></p><h4>Prev command</h4><p><font size="2">Selecting this command displays the previous pageof data fields. Each page of data fields must be entered before therecord is stored.</font></p><h4>Write command</h4><p><font size="2">Selecting this command writes the entered ormodified record to the database. If the automatic set connectionfeature is enabled, then the record will also be connected to eachset of which it is a member and for which a current owner haspreviously been set.</font></p><h4>Store_key command</h4><p><font size="2">This command is used to store optional keys inthe key file. A selection list of optional keys will be displayed.Select the one to be stored for the current record.</font></p><h4>Delete_key command</h4><p><font size="2">This command is used to delete optional keys fromthe key file. A selection list of optional keys will be displayed.Select the one to be deleted from the current record.</font></p><h4>Owner command</h4><p><font size="2">This command is used to assign, from the currentrecord, the current owner of the selected set. It is provided hereto facilitate data entry. Note that all sets are listed, but notall sets will allow the current record to be the ownerrecord.</font></p><h4>Connect command</h4><p><font size="2">Selecting this command connects the currentrecord to the set selected from the displayed list of sets. It isprovided here to facilitate data entry. Note that all sets arelisted, but not all sets will allow the current record to be amember record. To succeed, the current record must be of thecorrect type, must not already be connected to the set, and acurrent owner for the set instance must already beestablished.</font></p><h3><a name="DataField" id="DataField"></a>8.3.3 Editing a DataField</h3><p><font size="2">In the <b>Display/Edit Record</b> submenu,selecting the <b>Edit</b> or the <b>Init</b> command allows you toedit a record one data field at a time. <b>ida</b> editingincorporates many of the VI editor commands (see Table8-2).</font></p><p>All editing is performed in the editing field. Just above theediting field, the name of the field being edited is displayed. Ifthis field already contains data, the data will be displayed in theediting field. Arrows on either end of the editing field pointinward if all the data in the field fits on the screen, or outwardin the direction where more data can be found. The entire contentsof the field are accessed by horizontally scrolling orrepositioning through the field, using cursor-positioning fieldedit commands.</p><p>You can move to different data fields by using the up and downarrow keys, or by pressing <Enter> or <Tab> to move tothe next field. Pressing <Enter> or <Tab> on the lastfield, or pressing <Esc> at any point, will return you to the<b>Display/Edit Record</b> submenu.</p><p>The format of the displayed data is similar to the format thatwould be used if the data were statically initialized in a Cvariable declaration. Each item of an arrayed (non- string) datafield is separated by commas and specified in its natural sequence.Structure fields must be enclosed by braces ({ }). Characterstrings do not need to be delimited by quotation marks except whenincluded as part of a <b>struct</b> field. Sub-fields of<b>struct</b> fields cannot be edited independently and, in fact,they are displayed only in the <b>struct</b> field. All C escapecodes (for example, <b>\n, \f, \r, \ddd</b>) can be entered intocharacter fields.</p><p>One-dimensional character arrays are always treated as strings,terminated by a null byte (<b>\</b>0). Multi-dimensional characterarrays will display the entire length of the field.</p><p>Fields of type <b>DB_ADDR</b> are displayed and entered as <b>[f:r]</b>, where <b><i>f</i></b> is the file number and<b><i>r</i></b> is the record number. As an example,<b>[3:11717]</b> is the database address of the record located atslot number 11717 in file number 3.</p><p>Repeating data items in arrayed data fields are indicated with a<b>d*</b> prefix where <b>d</b> is the decimal number ofrepetitions and "<b>*</b>" indicates a repeating field.</p><p>The following table lists some examples of the aboverequirements.</p><p align="center"><b>Table 8-1. Example Data Field Contents</b></p><table border="0" cellpadding="7" cellspacing="0" width="542"><tr><td valign="top" width="28%"><p><b><font size="2"><font face="Default">FieldSpec</font></font></b></p></td><td valign="top" width="72%"><p><b><font size="2"><font face="Default">Display</font></font></b></p></td></tr><tr><td valign="top" width="28%"><p><font face="Courier" size="1">char str[255];</font></p></td><td valign="top" width="72%"><p><font face="Courier" size="1">This needs to be scrolled to seeth></font></p></td></tr><tr><td valign="top" width="28%"><p><font face="Courier" size="1">int array[10];</font></p></td><td valign="top" width="72%"><p><font face="Courier" size="1">>12,15,312,74,5,5*0<</font></p></td></tr><tr><td valign="top" width="28%"><p><font face="Courier" size="1">struct {</font></p></td><td valign="top" width="72%"><p><font face="Courier" size="1">>{"Joelle",6},{"Rebecca",4},{"Scott",2},{"K&></font></p></td></tr><tr><td valign="top" width="28%"><p><font face="Courier" size="1">char name[15];<br>int age;<br>} children[7];</font></p></td><td valign="top" width="72%"> </td></tr><tr><td valign="top" width="28%"><p><font face="Courier" size="1">DB_ADDR tree[2];</font></p></td><td valign="top" width="72%"><p><font face="Courier" size="1">>[2:1377],[2:1381]<</font></p></td></tr><tr><td valign="top" width="28%"><p><font face="Courier" size="1">char lines[10][10]</font></p></td><td valign="top" width="72%"><p><font face="Courier" size="1">>line 1\n\0\0\0line2\n\0\0\0line3\n\></font></p></td></tr></table><h3><a name="EditCommands" id="EditCommands"></a>8.3.4 Using EditModes and Field Edit Commands</h3><p><font size="2">The current editing mode is shown in the upperright corner of the screen. There are three modes:</font></p><div style="margin-left: 4em"><p>Command mode indicates that the field edit commands are enabled.Table 8-2 lists the edit commands available in Command mode.</p><p>Insert mode is initiated by the <b>i</b>, <b>a</b>, and <b>A</b>commands, allowing data to be inserted into the field. Pressing<Esc> returns to Command mode.</p><p>Replace mode (<b>R</b> command) allows a type-over capability,where characters under the cursor are replaced by those typed atthe keyboard. Pressing <Esc> returns to Command mode.</p></div><p align="center"><b>Table 8-2. ida Field Edit Commands andDescriptions</b></p><p align="center"> </p><center><table border="1" cellpadding="7" cellspacing="1" width="537"><tbody><tr><td valign="top" width="21%"><p><b><font size="2">Command</font></b></p></td><td valign="top" width="79%"><p><b><font size="2">Description</font></b></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">i</font></b></p></td><td valign="top" width="79%"><p><font size="2">Insert characters before the cursor.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">a</font></b></p></td><td valign="top" width="79%"><p><font size="2">Append characters after the cursor.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">A</font></b></p></td><td valign="top" width="79%"><p><font size="2">Append characters to the end of thefield.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">r</font></b></p></td><td valign="top" width="79%"><p><font size="2">Replace one character.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">R</font></b></p></td><td valign="top" width="79%"><p><font size="2">Replace (types over) existingcharacters.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">h</font></b></p></td><td valign="top" width="79%"><p><font size="2">Move the cursor one character to theleft.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">l</font></b></p></td><td valign="top" width="79%"><p><font size="2">Move the cursor one character to theright.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">w</font></b></p></td><td valign="top" width="79%"><p><font size="2">Move the cursor forward one "small" word,delimited by anything other than letters, digits, orunderscores.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">W</font></b></p></td><td valign="top" width="79%"><p><font size="2">Move cursor forward one "big" word, delimited byspaces.</font></p></td></tr><tr><td valign="top" width="21%"><p><b><font size="2">b</font></b></p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?