The Editor Tool

Description

The Editor Tool allows the user to edit, save, download/upload, and execute DMC application code.

An Editor Tool in the stack, and a Terminal Tool docked right.

Features

The Editor Tool provides for the following features.

  • Open new or saved programs.
  • Save programs to disk.
  • Block commenting/uncommenting.
  • Goto label or line number.
  • Find/replace specific substrings.
  • Download programs to hardware.
  • Upload programs from hardware.
  • Program hardware control with Stop (ST) and Execute (XQ).
  • Left margin line numbering showing actual DMC code lines, REMs and C-Style comments uncounted.
  • Code line numbering at bottom margin showing actual text file line numbers, Column count, and selection size.
  • Right margin indicator shows 40 or 80 character width depending upon connection.
  • Printing of DMC programs.

Using a multiple document interface, The Editor allows for documents to be viewed in tabbed, tiled, and cascaded layouts.

Cascaded programs in the Editor's multiple document interface (MDI).

The GDK Preprocessor

GDK and gclib now support an enhanced code preprocessor. The preprocessor modifies the program prior to download providing a number of language features not present in pure DMC code.

Quad Hash to Enable

  • The first two lines of DMC code must start with ## in order to enable new preprocessor features.
  • The line can contain just the hash marks, a preprocessor directive as outlined below, or a comment.

Double Hash Comment

  • Most preprocessor statements begin with a double hash, ##.
  • When proceeded by a space, the double hash acts like a REM comment. I.E. it is stripped from code prior to download.
  • When proceeded by a character other than space, ## is interpreted as a preprocessor directive. For example, see ##option below.
  • Double hash lines are removed from the program only when the preprocessor is enabled with a quad hash.
  • Double hash comments can be useful for documenting code, with the Author, Application, and so on.

Compression Levels

  • Level 0 (mandatory)
    1. Remove lines beginning with REM
    2. Remove trailing semicolons.
    3. Comment blank lines with '.
    4. Remove white space (space/tab) in front of # (label declarations).
    5. Remove white space after commands.
    6. Line ends changed to carriage return.
    7. Replace leading tabs with double space.
    8. Replace non-leading tabs with single space.
    9. A backslash (\) character on a line other than a preprocessor line will result in an error.
  • Level 1
    1. Remove unnecessary spaces. Strings, comments ('), and no-ops (NO) are not changed.
  • Level 2
    1. Remove comments (') but not no-ops (NO).
  • Level 3
    1. Remove no-ops (NO).
  • Level 4
    1. Break apart compound lines that are too long.
    2. Compact lines of code to maximize line usage.
    3. Use backtick to support long lines where applicable.

C-style comments

Preprocessor Directives

The ##include and ##option directives provide further preprocessor functionality. For a full definition of the preprocessor, see the gclib reference documentation.

Invoke the Preprocessor

From the More options... menu choose Preprocess Program to run the current editor through the preprocessor without downloading the code.

Hot Keys

  • Ctrl + N | New
  • Ctrl + O | Open
  • Ctrl + S | Save
  • Ctrl + Shift + S | Save As..
  • Ctrl + D | Download to Hardware
  • Ctrl + Shift + D | Download to Hardware and Execute
  • Ctrl + U | Upload from Hardware
  • Ctrl + / | Toggle Comment Block
  • Ctrl + F | Find/Replace
  • F3 | Find Next
  • Shift + F3 | Find Previous

Debugger

For more information on the debugger see GDK Debugger Docs