SM32 allows you to define constants in the configuration. These constants are then used by the compiler at compile time. For example if you used the number 3.1415 throughout your code you might want to add the constant PI with the value 3.1415 to your configuration. Then you could have:
1000 LET X = #PI * YIn your code. Note it is only used at compile time !! The following defines are of note as they give meaning to some numeric parameters (they are always part of the configuration):
defines for the X in A$=K![X] #KSA_CURRENT = 0 #KSA_CURRENT_KEY = 1 #KSA_NEXT = 2 #KSA_NEXT_KEY = 3 #KSA_PREV = 4 #KSA_PREV_KEY = 5 #KSA_FIRST = 6 #KSA_FIRST_KEY = 7 #KSA_LAST = 8 #KSA_LAST_KEY = 9CVS function
defines for the X in A$=CVS(B$,X) #CVS_NOTHING = 0 #CVS_STRIP_LEADING = 1 #CVS_STRIP_TRAILING = 2 #CVS_TO_UPPER = 4 #CVS_TO_LOWER = 8 #CVS_MAKE_PRINTABLE = 16 #CVS_SPACES_TO_SPACE = 32 #CVS_COMMA_DECIMAL = 64
Keyed String Arrays (KSA's) are very common in SM32.
They resemble a memory based DIRECT file but never return DOM or END errors. They have a normal variable
name followed by a '!'. To use a KSA it must be dimensioned. The index into the array is a
'KEY STRING'
REM MK=max key length, A=allocation size DIM K![MK,A]; DIM K! ; REM use default of 64,2048The allocation size is the size the KSA grows by, as it needs space.
Usage: 1000 DIM K! 1005 K!["name"]="Ken Yerex" 1010 N$=K!["name"]If a key does not exist "" is returned and position is set to the next higher 'KEY STRING'
SM32 has many configurable options. It is hoped that users trying Quick Start will not have to change the default configuration. The current configuration can be viewed/changed by selecting Options - Edit Current Configuration from the SMDE Menu Bar.
The configuration can be contained in either the Registry or in an .SM32 file.| Parameter | Action |
|---|---|
| None | If the file SM32.SM32 exists it is used as the config file If it does not the default Registry branch is used |
| XXXX.SM32 | The file XXXX.SM32 is used as the config file |
| XXXX | The registry branch XXXX is used |
| If the Registry Branch or Configuration File does not exists. It is created with a default configuration with the Initial Statement set as: RUN "SM32CONFIG" This gives a way to distribute a Registry Based configuration |
|
| Key Stokes | Action |
|---|---|
| 1300: | Re-compile Statement 1300 so it becomes the last compiled statement |
| End Key | Displays statement 1300 and place cursor at end of line |
| Home Key | Place cursor at beginning of line |
| Left Arrow Key | Moves cursor 1 position to the left |
| Right Arrow Key | Moves cursor 1 position to the right |
| Insert Key | Toggles the insert mode Always starts in type over mode. When in insert mode a space appears where your inserting character will go |
| Ctrl B Key | Moves the cursor left to the end of the next word |
| Ctrl F Key | Moves the cursor right to the start of the next word |
| Ctrl K Key | Erases all the characters from the character under the cursor to the end of the line |
| Ctrl J Key | Same as Ctrl K but also terminates the input |
| Enter Key | Terminates the input |