• No results found

Keyboard shortcuts

In document Free Pascal User Guide (Page 89-94)

A lot of keyboard shortcuts used by the IDE are compatible with WordStar and should be well known to Turbo Pascal users.

Below are the following tables:

1. In table (6.4) some shortcuts for handling the IDE windows and Help are listed.

2. In table (6.5) the shortcuts for compiling, running and debugging a program are presented.

3. In table (6.6) the navigation keys are described.

4. In table (6.7) the editing keys are listed.

5. In table (6.8) all block command shortcuts are listed.

6. In table (6.9) all selection-changing shortcuts are presented.

7. In table (6.10) some general shortcuts, which do not fit in the previous categories, are pre-sented.

Table 6.4: General

Command Shortcut key Alternative

Help F1

Goto last help topic ALT-F1 Search word at cursor position in

help

CTRL-F1

Help index SHIFT-F1

Close active window ALT-F3

Zoom/Unzoom window F5

Move/Zoom active window CTRL-F5

Switch to next window F6

Switch to last window SHIFT-F6

Menu F10

Local menu ALT-F10

List of windows ALT-0

Active another window ALT-<DIGIT>

Call grep utility SHIFT-F2

Exit IDE ALT-X

Table 6.5: Compiler

Command Shortcut key Alternative

Reset debugger/program CTRL-F2

Display call stack CTRL-F3

Run as far as the cursor F4 Switch to user screen ALT-F5

Trace into F7

Add watch CTRL-F7

Step over F8

Set breakpoint at current line CTRL-F8

Make F9

Run CTRL-F9

Compile the active source file ALT-F9

Message F11

Compiler messages F12

Table 6.6: Text navigation

Command Shortcut key Alternative

Char left ARROW LEFT CTRL-S

Char right ARROW RIGHT CTRL-D

Line up ARROW UP CTRL-E

Line down ARROW DOWN CTRL-X

Word left CTRL-ARROW LEFT CTRL-A

Word right CTRL-ARROW RIGHT CTRL-F

Scroll one line up CTRL-W

Scroll one line down CTRL-Z

Page up PAGEUP CTRL-R

Page down PAGEDOWN

Beginning of Line POS1 CTRL-Q-S

End of Line END CTRL-Q-D

First line of window CTRL-HOME CTRL-Q-E

Last line of window CTRL-END CTRL-Q-X

First line of file CTRL-PAGEUP CTRL-Q-R

Last line of file CTRL-PAGEDOWN CTRL-Q-C Last cursor position CTRL-Q-P

Find matching block delimiter CTRL-Q-[

Find last matching block delimiter CTRL-Q-]

Table 6.7: Edit

Command Shortcut key Alternative

Delete char DEL CTRL-G

Delete left char BACKSPACE CTRL-H

Delete line CTRL-Y

Delete til end of line CTRL-Q-Y

Delete word CTRL-T

Insert line CTRL-N

Toggle insert mode INSERT CTRL-V

Table 6.8: Block commands

Command Shortcut key Alternative

Goto Beginning of selected text CTRL-Q-B Goto end of selected text CTRL-Q-K

Select current line CTRL-K-L

Print selected text CTRL-K-P

Select current word CTRL-K-T

Delete selected text CTRL-DEL CTRL-K-Y Copy selected text to cursor

posi-tion

CTRL-K-C Move selected text to cursor

posi-tion

CTRL-K-V Copy selected text to clipboard CTRL-INS

Move selected text to the clipboard SHIFT-DEL

Indent block one column CTRL-K-I Unindent block one column CTRL-K-U Insert text from clipboard SHIFT-INSERT

Insert file CTRL-K-R

Write selected text to file CTRL-K-W Uppercase current block CTRL-K-N Lowercase current block CTRL-K-O

Uppercase word CTRL-K-E

Lowercase word CTRL-K-F

Table 6.9: Change selection

Command Shortcut key Alternative

Mark beginning of selected text CTRL-K-B Mark end of selected text CTRL-K-K

Remove selection CTRL-K-Y

Extend selection one char to the left SHIFT-ARROW LEFT

Extend selection one char to the right

SHIFT-ARROW RIGHT

Extend selection to the beginning of the line

SHIFT-POS1 Extend selection to the end of the

line

SHIFT-END

Extend selection to the same col-umn in the last row

SHIFT-ARROW UP

Extend selection to the same col-umn in the next row

SHIFT-ARROW DOWN

Extend selection to the end of the line

SHIFT-END

Extend selection one word to the left

CTRL-SHIFT-ARROW LEFT

Extend selection one word to the right

CTRL-SHIFT-ARROW RIGHT

Extend selection one page up SHIFT-PAGEUP

Extend selection one page down SHIFT-PAGEDOWN

Extend selection to the beginning of the file

CTRL-SHIFT-POS1 CTRL-SHIFT-PAGEUP

Extend selection to the end of the file

Search and replace CTRL-Q-A

Set mark CTRL-K-N(where n can be 0..9)

Goto mark CTRL-Q-N(where n can be 0..9)

Undo ALT-BACKSPACE

Porting and portable code

7.1 Free Pascal compiler modes

The Free Pascal team tries to create a compiler that can compile as much as possible code produced for Turbo Pascal, Delphi or the Mac pascal compilers: this should make sure that porting code that was written for one of these compilers is as easy as possible.

At the same time, the Free Pascal developers have introduced a lot of extensions in the Object Pascal language. To reconcile these different goals, and to make sure that people can produce code which can still be compiled by the Turbo Pascal and Delphi compilers, the compiler has a concepts of

’compiler modes’. In a certain compiler mode, the compiler has certain functionalities switched on or off. This allows to introduce a compatibility mode in which only features supported by the original compiler are supported. Currently, 5 modes are supported:

FPC This is the original Free Pascal compiler mode: here all language constructs except classes, interfaces and exceptions are supported. Objects are supported in this mode. This is the default mode of the compiler.

OBJFPC This is the same mode as FPC mode, but it also includes classes, interfaces and exceptions.

TP Turbo Pascal compatibility mode. In this mode, the compiler tries to mimic the Turbo Pascal compiler as closely as possible. Obviously, only 32-bit or 64-bit code can be compiled.

DELPHI Delphi compatibility mode. In this mode, the compiler tries to resemble the Delphi com-piler as best as it can: All Delphi 7 features are implemented. Features that were implemented in the .NET versions of Delphi are not implemented.

MACPAS the Mac Pascal compatibility mode. In this mode, the compiler attempts to allow all con-structs that are implemented in Mac pascal. In particular, it attempts to compile the universal interfaces.

The compiler mode can be set on a per-unit basis: each unit can have its own compiler mode, and it is possible to use units which have been compiled in different modes intertwined. The mode can be set in one of 2 ways:

1. On the command line, with the -M switch.

2. In the source file, with the {$MODE } directive.

Both ways take the name of the mode as an argument. If the unit or program source file does not specify a mode, the mode specified on the command-line is used. If the source file specifies a mode, then it overrides the mode given on the command-line.

Thus compiling a unit with the -M switch as follows:

fpc -MOBJFPC myunit

is the same as having the following mode directive in the unit:

{$MODE OBJFPC}

Unit myunit;

The MODE directive should always be located before the uses clause of the unit interface or program uses clause, because setting the mode may result in the loading of an additional unit as the first unit to be loaded.

Note that the {$MODE } directive is a global directive, i.e. it is valid for the whole unit; Only one directive can be specified.

The mode has no influence on the availability of units: all available units can be used, independent of the mode that is used to compile the current unit or program.

In document Free Pascal User Guide (Page 89-94)