• Aucun résultat trouvé

MODULE Demo PROCEDURE MODULE Demo PROCEDURE

Dans le document LOGITECH SOFIWARE ENGINEERING LIBRARY (Page 41-49)

MODULE Demo PROCEDURE MODULE Demo PROCEDURE MODULE Demo PROCEDURE MODULE Demo PROCEDURE ---> halt called

To be able also to debug all initialization codes of imported modules, module 'Debug' should be forced to be initialized as the first module. This can be accomplished by importing it as the first module in the main module of the application program.

MODUIA-2/86 Tutorial

KEYSTROKES AND THEIR DEFINmONS

The following section lists all the MODULA-2 Editor keystrokes and their definitions.

KEYSTROKE

Escapes from prompt boxes and dialogue boxes and from the editor itself. If you try to escape from the editor with unsaved modifications, you will be asked if you really want to do this.

Inserts a line-break, moves down one line, and indents. Functions the same as <Ctrl-O>, <CtrI-N>, and <Tab>.

Moves to the beginning of a text. (Also valid in menus) Moves the cursor to the top left comer of the window.

Moves to the end of a text. (Also valid in menus)

Slides the window upward over the text, approximately the height of the window.

Slide.s the window down over the text, approximately the height of the window.

If a block of text is selected, deletes it and places it in the scratchpad.

Otherwise deletes the character at the cursor position. If this is done beyond the end of a line, it will join the following line to the current one.

Inserts the contents of the scratch pad at the current cursor position.

(Note: Tab, in mod, does not function as it does in most standard editors).

Moves the cursor to an appropriate beginning column for the current line.

If the current line has something on it, Tab moves the cursor to the first non-blank. Otherwise, it looks backward for keywords or preceding text and positions the cursor to an appropriate indentation according to Modula-2 syntax.

If a block of text is selected with F8, Tab will indent (move to the right) all

Tutorial

If a block of text is selected with F8, Alt-Tab will 'unindent' (move to the left) all the lines by the indent factor.

Moves to the end of the current line.

Go to the next word.

Go to the previous word.

Scrolls the text up one line in the window.

Scrolls the text down one line in the window.

Deletes the entire line including the line-break and loads it into the scratchpad, replacing the old contents.

Moves to the beginning of the current line.

Moves the cursor Backward one character.

See Del.

Moves the cursor to the end of the current line.

Moves the cursor Forward one character.

Kills the rest of the line, to the right and loads it in the scratchpad, replacing the old contents.

Redisplays the screen.

Moves the cursor to the Next line.

Opens a line: Breaks the line, or inserts a new line.

Moves the cursor to the Preceding line.

Query replace: starting from the current position Replaces old string with new string. If you answer yes to the Query mode, the replace will stop after

MODULA-2/86

Help - Displays a very brief help text in a temporary window. (The help text is in the file MOD.HLP, so you can edit it.) Type <ESC> to go back to your text. All cursor movement keys are allowed to browse through the help text.

Gives system information about mod. Type <ESC> to go back to your text.

Syntax - Checks the syntax of the text as a Modula-2 module. It will either position you to the first error and display the error message in a box, or put up a box indicating that no errors were found. In either case, the box will go away as soon as you type something. The syntax checker requires that you properly indent your Modula-2 program.

Reloads the Configuration File.

Get - Prompts for a file name and loads the file in the current window. If the file you edit is a .MOD file, you don't need to specify the extension 'MOD' because it's used by default.

Splits the current window and asks for a file to load.

Opens a full window and asks for a file to load.

Save - Saves the current text in its associated file., Go to the specified line.

Tells you at what line and column the cursor is.

Compile - Invokes the MODULA-2 Compiler. Note: mod can only run a Compiler 2.0 or later. If the file has been modified, it will ask if you want you want to save it.

Go to next error after compilation with errors. It loops on the error list (maximum 30 errors). Allows you to work on an existing error listing file (.LST) even if you didn't evoke the compiler from the editor. This is very useful to correct all the compiler errors after a batch compilation. Note:

This keystroke is supported only with Compiler 2.0 or later.

Tutorial

Link· Invokes the MODULA-2 Linker. Note: mod can only run a Linker 2.0 or later.

Converts a number (eg: 123, -123, ObOOh, 867B, 45H) or a string (eg: "ab',

"Ab", 'a', "a") into a cardinal, integer, octal, hex, binary, or string.

Displays the ASCII table (file mod.asc)

Next Window - Switches to another window. If repeated, this command will cycle through all windows.

Enters any byte value [OOH .. FFH] at the current cursor position. This command is useful to enter a page break (=OCH) or special characters which don't exist on the keyboard.

Select· Starts selecting a block of text. All direct motion commands (Home, End, Arrows, Page Up, and Page Down) can be used to establish the other end of the selected region. The selected text is highlighted. (F8 acts like a switch _. if you make a selection and type F8 again, the second F8 cancels the selection.)

Main Menu - Calls up the Main Menu with the following commands:

• files

Calls up the File Menu. Functions the same as <Alt F9> .

• delete

Cuts a selected block of text from your program into the scratchpad;

removes the text from the program. Using F8, first select a block of text.

'Delete' this text and put it in the scratchpad.

• copy

Copies a selected block of text from your program into the scratchpad;

leaves the text in the program. Using F8, first select a block of text. 'Copy' into a scratchpad the text you've selected .

MODULA-2/86

Exits the editor. Functions the same as <Esc>. If you have modified your program, the editor will ask if you really want to exit without saving your modifications. Y

=

yes, N or <Esc>

=

no.

• syntax

Checks to see if your program is syntactically correct. Functions the same as F2.

• windows

Calls up the Window Menu. Functions the same as Alt-FIO.

File Menu - Calls up the File Menu with the following commands:

• compile

Calls the MODULA-2 Compiler and prompts for the program you wish to have compiled. Note: mod can only run a Compiler 2.0 or later. When finished compiling, type <ESC> to return to the editor. If errors are

detected by the compiler, the errors are displayed on the screen and a listing file with the error message is generated with the name, <prog>.LST. You can open a window in this file and check the errors, or better, use <Alt-FS>

to have an automatic positioning where the error occurred. Note: this feature requires a system with at least 398K bytes of main memory.

Only the overlay version of the Compiler can be called from mod. You cannot call 'M2C.EXE', the fully linked version of the Compiler.

• get

Prompts for the file name and reads in the file. Functions the same as F3.

• link

Calls the MODULA-2 Linker and prompts for the program you wish to have linked. Note: mod can only run a Linker 2.0 or later. When finished linking, type <ESC> to return to the editor. Only the overlay version of the Linker can be called from mod. You cannot call 'M2L.EXE', the fully linked version of the linker.

Tutorial

Allows you to change the name of a file. Especially useful if you want to retain a copy of an old file as well as the modified version of this file. You would rename the modified file and thus keep both files (.MOD is the default extension).

• run

Executes any MODULA-2/86 program that fits in memory (extension .LOD). Note: mod can only execute a program generated with a Compiler and Linker 2.0 or later. It prompts you for the name of the program you wish to execute. When the program has finished, type <ESC> to return to the editor.

• save

Saves the current text in its associated file. Functions the same as F4.

• write

Also saves text, but you specify the file name you wish to save. The default proposes the current file name. (.MOD is the default extension).

Pattern - Opens a window for editing the search pattern for editing. Note:

'<ESC>' inside the pattern window closes the pattern window and restores the old pattern. 'Enter' sets the new pattern and closes the window. Any other command saves and closes the pattern, and is then executed, including Search forward and Search backwards.

Window Menu - Calls up the Window Menu with the following commands:

• close

Closes the selected window. If more than one window is open, the one in which the cursor is positioned disappears. The window that remains open

MODUIA-2/86

KEYSTROKE

Tutorial

DEFINmON

• hor. split

Splits the current window horizontally. First, define where you want to split the window by positioning the cursor. Then select 'hor. split' from the menu to split the current window. If the cursor is in the upper left corner position when the hor. split is invoked, the current window will automatically be split in half. You then invoke F3 to get another file. This allows you to have two or more windows open at the same time.

• move

Moves the current window. Select 'move' from the menu. Moving the cursor defines the new position of the upper left corner of the window. Enter

<CR> to confirm this position and the window will move to this position.

• open

Creates a new window with the upper left corner at the current cursor position. The size of the screen determines the size of the new window.

• reshape

Reshapes the current window. Select 'reshape' from the menu. Moving the cursor defines the new position of the lower right comer of the window.

Enter <CR> to confirm this position and the window will reshape with the new lower right comer.

• vert. split

Splits the current window vertically. First, define where you want to split the window by positioning the cursor. Then select 'vert. split' from the menu to split a current window. If the cursor is in the upper left comer position when the vert. split is invoked, the current window will automatically be split in half. You then invoke F3 to get another file. This allows you to have two or more windows open at the same time.

• full screen

Makes the current window a full screen window which overlaps the other windows. All other windows remain unchanged and can be visited using F7.

It is not the reverse operation of vertical or horizontal split.

<Alt-a> .. <Alt-z> Inserts a template in the current window of the current cursor position

Tutorial MODULA-2/86

CONFIGURATION FILE

The file 'mod.con' is an ASCII file that contains system information and user definable templates for the MODULA-2 Editor.

Select the Compiler/Linker Drive

The MODULA-2 Editor is compatible with MODULA-2/86 Release 2.0 or later. If you try to invoke the MODULA-2 Compiler or Linker or run any MODULA-2/86 .LOD file, and you are using a version earlier than 2.0, you will get the following error:

Dans le document LOGITECH SOFIWARE ENGINEERING LIBRARY (Page 41-49)