Command syntax

Top  Previous  Next
http://www.Nu-Ware.com

Please read this advanced topic only if you want to alter the supplied lessons or write your own lessons. For normal program use you do not need this information.

 

NuCode is able to respond to certain lines in text files by altering program settings. This is how the Lesson files prepare the program for each lesson. These  special lines, all beginning with the // character pair are called commands and they conform to a set of rules…the command syntax.

 

If you are planning to modify the supplied lessons or even write your own course then this topic contains the information you need. Another source of information is the supplied Lesson files themselves.

 

General information follows:

 

The Use Lessons option must be checked for file commands to be recognized.

 

Any text to be played as code must appear at the end of the command list. If the command syntax is correct and the Use Lessons is checked then the command lines will not be played as code.

 

The lesson files are all text files that can be edited using any text editor. If you use a word processor then please be sure to save your files in text only format.

 

The file commands must all appear as a contiguous group of lines at the start of the file. NuCode assumes that the first line that doesnt start with a // character pair is the start of text to be played as code. Any  command lines that appear later would be ignored or played as code.

 

Any file command that is not recognized will be ignored. This allows lines beginning with the // character pair to be used as comments.

 

Many commands have a parameter list. The parameter list immediately follows an = symbol which follows the command itself. Multiple parameters are separated by commas.

 

Letter case is ignored in the commands.

 

Usually, only a subset of the available commands will be needed. If a command is not present (or has incorrect syntax) then the most recent command setting, or the setting loaded on program startup will be used by default.

 

List of commands and explanations follows:

 

NEXTFILE=<filename>

If filename exists this command enables the Next button in the Supplementary lesson window. Clicking on the Next button will subsequently select and load <filename>

Example: //nextfile=lesson13.txt

 

PREVFILE=<filename>

If filename exists this command enables the Previous button in the supplementary lesson window. Clicking on the Previous button will subsequently select and load <filename>

Example: //prevfile=lesson11.txt

 

NOTIFY=<yes><no>

This checks or unchecks the Play sound when time up control on the options page.

Example: //Notify=no

 

STOPIF=<nn>

If the user achieves an accuracy of nn% in the current code session and the number of characters typed is greater than the Accuracy slider on the Options page then the Stop button is automatically pressed.

Example: //StopIf=80

When the user achieves an accuracy of greater than 80% then the Stop button is automatically pressed.

 

RANDOM=<grouplength>,<group1,group2....>

This sets the random Length of groups control on the options page. It can also be used to select Filters options. The required filters are selected by listing them after the group length, separated by commas. Each group is represented by a number:

0

Letters

1

Numbers

2

Punctuation

3

Prosigns

Example: //random=5,0,1,2,3

Set random group length to 5 and enable all filters.

 

MODE=<n>

Sets the File read mode on the Play code page. Here are the mode numbers and their meanings:

0

Sequential read from file

1

Random words from file

2

Random characters from file

3

Random paragraphs from file

4

Random characters from internal generator

Example: //mode=2

Sets NuCode to read characters at random from the selected file.

 

TYPEDHIDE=<yes,no>

Sets the Hide option for the user typed window

Example: //TypedHide=no

 

SOURCEHIDE=<yes,no>

Sets the Hide option for the Code sent window.

Example: //SourceHide=no

 

ACCURACY=nn.

Sets the accuracy slider on the Options page. Allowed values for nn are between 1 and 255 inclusive. Note, the actual slider position will sometimes be “corrected” to a number close to nn.

Example: //accuracy=19, actual slider position will be set to 16

 

PAUSE=<yes,no>

Sets the Pause at end of words control on the options page.

Example: //pause=no, NuCode will not wait for the user to catch up

 

AUTO=<yes,no>

Sets the Automatic spaces control on the options page. Should always be set to <no> be used if a pause=yes command was used.

Example: //auto=yes, NuCode will add a space to users typing when code sent reaches end of word.

 

CLEAR=<yes,no>

Sets the Clear on restart control on the Options page.

Example: //clear=yes. Previous window contents are cleared when code play starts.

 

STOPAFTER=<nn>

The session timer sounds an alarm after nn seconds. To make the code stop nn should be a negative number. To turn the session timer off set nn to 0

Example: //stopafter=-60

At 60 seconds the timer alarm will sound and code will stop.

 

STOPATEND=<yes,no>

Sets the Stop code at end of file or paragraph control on the Options page.

Example: StopAtEnd=yes

Code play will stop when the end of file is reached.

 

AUTOSPEED=<constant,increase,adjust><1..60>or<1..20>

Switches the autospeed feature on/off. This is equivalent to checking one of the autospeed controls on the options page.

If increase is selected then follow this with a number between 1 and 60 to set how quickly the speed increases.

If adjust is selected then use a number between 1 and 20 to indicate how often speed should be adjusted.

If constant is selected the feature is switched off.

Example: //autospeed=adjust,10

Adjust speed to user responses every 10 seconds.

 

CODESPEED=<15,20><character pauses><word pauses>

Sets the speed for the code. Character speed can be 15 or 20 WPM. The character pauses can be set to a number from 1 to 20. 1 is standard Morse code while 20 gives large pauses. You may need to experiment to find the overall speed resulting from combinations of character speeds and character pauses. For example a character rate of 20 WPM combined with a character pause slider position of 6 gives an overall text speed of 8 WPM. The same applies to the word pause parameter, set it to 1 for normal pauses.

Example:

//CodeSpeed=20,6,1

Sets character speed to 20 WPM, overall speed to 8 WPM with no extra word pauses.

 

FILETITLE

Sets a title for the lesson. The title appears at the bottom of the supplementary lesson window in the status bar. Note, if a file title is not specified then the supplementary lesson window will not be displayed. This is deliberate and is a way to set up the program without displaying a supplementary page.

Example: //FileTitle=Introduction to the lessons.

 

STARTTEXT

This command has no parameters. However, all of the following command lines will be displayed as text on the supplementary lesson page. Each of the following lines must begin with the // characters. To some extent the displayed text is self-formatting. However, to force line feeds you can add blank lines, ones with just the // characters and no other text. These lines will be displayed until another valid command or a none command line is encountered.

Example:

//StartText

//Welcome to the NuCode lessons!

 

ENDTEXT

This operates just like the STARTTEXT command except that it will appear when the user (or the program) operates the Stop button during a code session. The text will be displayed in the supplementary window in red.

Example:

//EndText

//This concludes Lesson 1. Click on the Next button below to start Lesson 2.

 

End of command list.