Using MMEdit

The main edit window should work as expected. Many of the standard keyboard shortcuts are there as well as a long list of less common shortcuts.

The Code Formatter (Alt+O), indents code to make the code easier to follow. 
The Tab can bet set between 2 and 8 spaces and there can be extra indenting to emphasise labels and functions. Try it and see - all indenting is reversible.
Indenting does use some space so there is an option to remove all leading and trailing spaces to save space. 
Formatting code also helps draw attention to miss-matched conditional statements and looping structures.

It is strongly recommended that you convert your files to 'without numbers'.
The source code can have Unix or DOS/Windows style line endings.

The various options in the Edit window are remembered between sessions. Under File/Preferences, you can set options that MM Edit always starts with.

Many of the options only affect what you see and are not part of the code.
Saving or sending code to the Maximite will not include these 'features'.

Space characters can be highlighted. A space (or lack of) can cause havoc and can be difficult to see.
Keywords are coloured and converted to uppercase.

F1 will give syntax help and Shift_F1 will give you a comprehensive help on the selected keyword.

Physical line numbers are useful for debugging. The MM Basic interpreter will indicate which line gave an error. Having Physical line numbers turned on makes it easy to look at that line. Remember that sometimes the error is actually caused by a problem in a previous line.
If you are moving between two or three sections of the code, such as a subroutine and the code body or the initialisation area, bookmarks are very useful.
You can jump to and from subroutines and user functions by highlighting the name and click - you're there. If you don't have function name selected, you will be given a popup list of functions to choose from.

Indenting lines of code can make it a lot easier to read (and debug).
With auto-indent turned on, the indent used will carry forward to the next line.
Backspace when you want to remove the indent and the new indent setting will carry forward. Indent does affect the final code.
You can also go directly to a physical line number with Ctrl+G
'Format' will reformat you code with indents. This is a fast way to check for incorrect structure in your code. Alt-O is a shortcut for 'Format'

To make it easier to reuse code, you can add your library files using two methods.
In the Edit menu, you can Insert a file at the current location (actually after the current line) or at the end of the file.
The second method requires INCLUDE directives.
In the main code a comment line with either '$INCLUDE:' (Quick Basic style) or '#INCLUDE' (C style) with indicate where the include file is to be placed.
Running 'merge include files' from the 'Program' menu will insert the library files into the main file. A comment line will be inserted at the end of the include file so you know what code was added. The original include directive has another comment (') added to prevent subsequent merges from adding a second copy of the include file.
An include file can have its own includes.
In both cases, the added code is now part of the main file.

Transferring your code to the Maximite can be achieved by three methods.

The fast way is to click on the 'Load and Run' button. This will load the current program onto the Maximite.
In Preferences or the Advanced menu you can set 'Run on Load' to run the program immediately after loading.
'set clock on load' to set the clock to the computer time before loading.
'auto crunch on load' removes all comments before uploading but keeps the blank lines.
'Delete blank lines' causes autocrunch to delete all blank lines. This will result in the line numbers on the Maximite being different to the line numbers in the editor and make fault finding more difficult.
'CLS on load' clears the Terminal window after loading.
On devices with file systems, the file is uploaded as 'temp.bas'. If you hold Shit when selecting 'load and run' or 'load' in the Chat window, the original file name is used instead of  'temp.bas'

Devices without file systems load the file into memory.

Using 'MM File' will transfer the code from the Edit window (or a file on the PC) to a file on the Maximite drive A or B. The MicroMite loads the file into memory.
'load and run' uses XMODEM to transfer, 'Load' from the Chat window uses AUTO or AUTOSAVE.


Last edited: 03 November, 2020