Using the editor

Top  Previous  Next

Emergence BASIC's built in editor has many of the common features of a standard text editor with the addition of syntax coloring.  With syntax coloring every statement or function that is a built in component of EBASIC is highlighted in a user selectable color.  This makes your code more readable and easier to find errors.

Open a new program by selecting File and choosing New->Emergence Source File from the main menu bar and type in the following program statements in the new editor window.
 

OPENCONSOLE
PRINT "Hello World"
DO
UNTIL INKEY$ <> ""
CLOSECONSOLE
END

Notice the blue coloring of the EBASIC program statements.  If you make a mistake and misspell a program statement you will immediately know due to its lack of color.

Now that we have some text in the editor we can explain some of the key commands the editor responds to.

Key

Action

<Page Up>

Moves one page up

<Page Down>

Moves one page down

Up Arrow

Moves one line up

Down Arrow

Moves one line down

<CTRL> + A

Selects all text

<CTRL> + C

Copies selected text to clipboard

<CTRL> + F

Opens the 'Find' dialog

<CTRL> + H

Opens the 'Find/Replace' dialog

<CTRL> + X

Cuts selected text and copies to clipboard

<CTRL> + V

Pastes text from clipboard at caret position

<CTRL> + Z

Undoes the previous text operation (Undo)

<CTRL> + Y

Reverses the previous undo operation (Redo)

<CTRL> + S

Saves the current document

<CTRL> + O

Opens a saved document

<CTRL> + N

Creates a new editor document

<HOME>

Moves the caret to the beginning of the current line

<END>

Moves the caret to the end of the current line

<CTRL><HOME>

Moves to the beginning of the document

<CTRL><END>

Moves to the end of the document

<Backspace>

Deletes the previous character before the caret

<Delete>

Deletes the next character after the caret

<TAB>

Tabs selected text over by one position

<SHIFT><TAB>

Removes tabs from the beginning of each selected line
 (de-tab)

F4

Executes the currently built project

F5

Compiles the source file currently in view

<CTRL> + F5

Rebuilds the currently opened project

F8

Builds a single file executable

<CTRL> + F8

Compiles the current project or source file and executes

<CTRL> + Keypad+

Magnify text size.

<CTRL> + Keypad-

Reduce text size.

<CTRL> + Keypad/

Restore text size to normal.

<CTRL><TAB>

Cycle through recent files.

<CTRL><Backspace>

Delete to start of word.

<CTRL>< Delete>

Delete to end of word.

<CTRL><SHIFT><Backspace>

Delete to start of line.

<CTRL><SHIFT><Delete>

Delete to end of line.

<CTRL><HOME>

Go to start of document.

<CTRL><SHIFT><HOME>

Extend selection to start of document.

<ALT><HOME>

Go to start of display line.

<ALT><SHIFT><HOME>

Extend selection to start of display line.

<CTRL><END>

Go to end of document.

<CTRL><SHIFT><END>

Extend selection to end of document.

<ALT><END>

Go to end of display line.

<ALT><SHIFT><END>

Extend selection to end of display line.

<CTRL> + Keypad*

Expand or contract a fold point.

<CTRL> + F3

Find selection.

<CTRL><SHIFT> + F3

Find selection backwards.

<CTRL> + L

Line cut.

<CTRL><SHIFT> + T

Line copy.

<CTRL><SHIFT> + L

Line delete.

<CTRL> + T

Line transpose with previous.

<CTRL> + [

Previous paragraph. Shift extends selection.

<CTRL> + ]

Next paragraph. Shift extends selection.

<CTRL> + Left

Previous word. Shift extends selection.

<CTRL> + Right

Next word. Shift extends selection.

<CTRL> + /

Previous word part. Shift extends selection

<CTRL> + \

Next word part. Shift extends selection.

There are other shortcuts available for use. Explore the main menu of the IDE to determine shortcuts to commonly used menu options.

Selecting Text

To select text for copying and cutting place the mouse cursor (I-Beam) over the first character of the text to select.   Press the left mouse button down and ‘drag’ the cursor over the text to select. If you drag past the confines of the window it will automatically scroll allowing the continued selection of text until the beginning or the end of the document

If any key is pressed when text is selected then the selected portion will be replaced with the new text.   The selected portion can also be deleted by pressing the <Delete> key.

Text may also be selected using the keyboard by holding the SHIFT key down and pressing one of <HOME>, <END>, <PAGEUP>, <PAGEDOWN>, or the arrow keys.

Text may also be selected from the current caret position to the position clicked with the left mouse button by holding down the SHIFT key.

Saving the file

To save the current program to file select File > Save from the main menu bar.  The default extension for Emergence BASIC is .EBA and should not be changed to anything else. For include files the default extension is .INC

Editor options

You can modify many of the default characteristics of the text editor by opening the editor options dialog. Select the File menu and choose Editor Options... Syntax coloring, tab widths,  line numbering and font used for text display is all user selectable. A mono-spaced, or fixed  font is recommended for programming use. Some True Type fonts do not display line numbers well.