• Aucun résultat trouvé

Using Syntax-Directed Editing Features

If you have a Pascal or C programming background, you can use the E Editor for development of code because E Editor provides syntax-directed editing for Pascal and C files.

When ENTER or the SPACEBAR is pressed, the E Editor looks at the first word in the line and enters the rest of the structure when you press CTRL+X if it

understands it. Structure expansion can include IF statements, loops, case statements, and comments.

Typical syntax-directed editing features can be demonstrated by the following sequence:

1. Type e newfile. C

In this example the file name is NEWFILE.C. Remember that the file's extension must be .C for syntax-directed editing to work.

2. Type main and press the SPACEBAR, followed by pressing CTRL+X.

Enter the main statement.

3. Then type if and press the SPACEBAR followed by preSSing CTRL+X.

This sequence edits a new file called newfile.c and by pressing the SPACEBAR followed by pressing CTRL+X in both instances above you have inserted the rest of the MAIN and IF structures.

If you find automatic expansion distracting, you can turn it off. Pressing CTRL+X

The E Editor automatically expands the syntax of the Pascal or C languages according to the file's name and extension. For example, if the user edits a file called TEST.C, the E Editor will know this file contains C language programs.

Box comments can also be created easily according to the syntax particular to the language.

Summary of E Editor Commands

The following table briefly summarizes the tasks the E Editor can do from the E Editor command line.

In the following table, some of the commands are shown in both uppercase and lowercase letters. You only have to type the uppercase letters for these commands to work. For example, instead of typing bottom, you only need to type bot. If a command has all uppercase letters, you must type the entire command name.

Command Syntax Usage

nnnn Moves the cursor to the line number you specified. The current line number is displayed near the bottom of the editing screen.

+ [nnnn] Moves forward (down) nnnn lines. If no number is specified, the

ADD Adds the marked block containing numeric expressions. See

"Adding and Multiplying Numbers" on page 142. Real numbers are not supported.

APPEND [filespec] Appends marked text to the file filespec. If no text is marked, the entire current file is taken as the source. In the E Editor, the APPEND and the PUT commands are basically the same.

AUTOSAVE [nnnn ION I Saves the current file to a temporary file after you press the ENTER OFF] key a specified number of times. If a number or ON is specified,

the name of the temporary file is shown. If no number is given, the current AUTOSAVE value (nnnn) is displayed.

Note: These temporary files are saved in case of" system or power

Command Syntax Usage

BOX 1 I 2 I 3 I 4 I 5 I 6 I Draws a box around marked text block. The arguments are listed CIPIAIEIRIBI on the screen if the BOX command without an argument.

Icharacter

C / oldtext! newtext/ Changes the oldtext to the newtext string. The 'I' can be changed to any character; the first character after the 'e' and at least one space is used as the string delimiter. The third delimiter is needed only if options are specified. (See "Searching for and Replacing Text" on page 135 for details.)

CD [path] If path is specified, changes current directory to path. If no path is specified, the current directory is shown in the function key text area.

CENTER If a line ~s marked, centers the text on the line according to the margins specified. If a block is marked, the text in the block is centered within the limits of the block.

CHR ASCII character code Displays the character associated with the ASCII character code specified.

DOLINES Executes the marked lines and works only if the text contained in the marked lines are E Editor or DOS commands.

[DOS] [commandJ Runs the DOS command processor to execute the command. If no command is specified, you exit the E Editor temporarily and return·

to DOS. To return to the editing session, type exi t at the DOS 6 I B Ilcharacteij options and their graphic representations are shown in the function

key text area. shorthand for the same directory or file name as the currently open file's directory or file name. If the /q option is given, the message Saving ... is not displayed.

GET filespec Gets a file and inserts its text on the next line" after the cursor position. You can use the equal sign (=) as a shorthand for the same directory or file name as the currently open file's directory or fHe name.

HELP Opens the online file for help on the E Editor combination keys, edit commands, cursor movement keys, function keys, and editor

Command Syntax Usage the second delimiter control the direction, scope, and uppercase and lowercase sensitivity of the search. The command name (L) can be omitted for convenience; in which case, the delimiter must be a slash (I).

After a L (locate) command, pressing CTRL+F repeats the search with the same options. See details in "Searching for and Replacing

LOWERCASE Converts all uppercase alphabetic characters in the marked area to lowercase.

MArgins left right new pgph Sets the margins with three values: the first number is forthe column number on the left, the second number is the column number on the right, and the third number is the number of spaces to indent the start of a new paragraph. For example, the

new-paragraph indentation occurs when you press ALT +P. Words typed past the right margin are wrapped to the next line. left and new pgph must be less than right.

MATCHTAB [ON I OFF] If set on, the TAB and SHIFT+TAB keys use the previous line's columns for the current line's tab stops. The previous line's columns are defined by the first letter of each word. If no values are given, the current tabs are displayed.

MATH expression Computes expression and returns result to the E Editor command line. The output number is a decimal number. Input numbers can be hex, octal, or decimal. Real numbers are not supported, only whole integers in the range -32768 to 32767. All intermediate results must also be in this range. Valid operators are +, -, I, and * See "Calculating Mathematical Expressions" on page 143 for further details.

MATHO expression Same as MATH command but output is octal.

MATHX expression Same as MATH command but output is hexadecimal.

MULT Multiplies the numbers in the marked area and prints the product in the row underneath the marked area.

Command Syntax avoid overwriting the original. If no filespec is given, the current file name is displayed on the E Editor command line where it can be easily modified.

Creates a new window containing the file specified. The options available are the same as the E command options. This command already exists it's appended rather than overwritten as before.

For convenience, filespec can be omitted if you want to repeat a the currently open file's directory or file name.

Displays the current system date in the form:

Today is Friday, July 16, 1993.

This particular command results in the error number 272 (Error in tab settings) being displayed below the E Editor command line.

Saves the file to disk, using the current name if none is specified.

You can use the equal sign (=) as a shorthand for the same directory or file name as the currently open file's directory or file name. If the /q option is given, the saving message is not displayed.

If the IT option is specified, tab compression is performed. If there are eight spaces beginning in the first column anywhere in the file,

Command Syntax Usage

SIZE Allows resizing a messy desk window with cursor keys. The SIZE command cannot be used with tiled windowing configuration.

SORT [R] [C] If no area is marked, sorts the entire file. If an area is marked, the entire lines are sorted with the marked columns treated as the sort key. The IR option specifies a reverse (descending) sort. The IC option specifies case-insensitive and ignores whether the case is uppercase or lowercase.

Allows you to sort a directory listing (for example, first by extension and again by file name). During the second sort, lines with equal file names are left in extension order.

TABS n1 n2 ... n32 Sets tab stops used by TAB and SHIFT+TAB keys. If only one tab stop is specified (for example, tabs 8), the E Editor interprets this as meaning that the user wants 32 tabs set, each 8 spaces apart, beginning with column 1. In this case, the result would be the same as issuing the following command:

tabs 1 9 17 25 ., . 247

The tab stops must be listed in ascending order.

TOP Moves to the top of the current file.

UPPERCASE Converts all lowercase alphabetic characters in the marked area to uppercase letters.

VER Displays the version of the E program on the status line and pauses the E Editor until you press ENTER. For example:

EVersion 3.12. Press any key.

WindowStyle [ 1 1213 I 4 Sets active window style. The different styles adjust the location of 15] the E Editor command line and the presence or location of the

command and status lines. The WINDOWSTYLE command has no effect with the messy desktop windowing configuration.

Chapter 9. Connecting Computers

Using the InterLnk program and a cable, you can easily connect one computer to another computer to:

Transfer files between computers.

Use one computer to run programs located on another computer.

Access information without having to copy files from one computer to another using diskettes.

Assume you regularly gather information in the field using your laptop computer to record the information. When you return to the home office, you need to transfer the information to a database on your desktop computer. Using the InterLnk program, you can directly add the information you have gathered to the database on your desktop computer and print out the new information without copying files to and from diskettes.

Laptop (Client)

Laptop Drives A C D

Desktop Drives

E equals A Fequals B G equals C

Desktop (Server)

Documents relatifs