The Editor Tool allows the user to edit, save, download/upload, and execute DMC application code.
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.
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.
- Level 0 (mandatory)
- Remove lines beginning with REM
- Remove trailing semicolons.
- Comment blank lines with '.
- Remove white space (space/tab) in front of # (label declarations).
- Remove white space after commands.
- Line ends changed to carriage return.
- Replace leading tabs with double space.
- Replace non-leading tabs with single space.
- A backslash (\) character on a line other than a preprocessor line will result in an error.
- Level 1
- Remove unnecessary spaces. Strings, comments ('), and no-ops (NO) are not changed.
- Level 2
- Remove comments (') but not no-ops (NO).
- Level 3
- Remove no-ops (NO).
- Level 4
- Break apart compound lines that are too long.
- Compact lines of code to maximize line usage.
- Use backtick to support long lines where applicable.
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.
- 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
For more information on the debugger see GDK Debugger Docs