User Guide
DSP Code Component
Syntax Colouring
The editor colours the code to indicate correct syntax. Input/Output commands, operators and brackets are purple, variables are blue and
data types and functions are green.
If at some point the syntax colouring stops and all text after that point turns black, this is an indication that there is an error in the syntax at
that point.
Editor
The code editor supports copy and paste through the standard shortcut keys (CTRL+C, CTRL+V). A local undo is also implemented to allow
you to undo and redo typing, deletions, pastes etc. The local undo applies to any changes you make during a particular session (Between
clicking in the component and clicking away). After that you can still undo via the application’s undo system, but this will only go back through
changes made between edits.
You can scroll using the mouse wheel or use the cursor keys. You can page using the PGUP and PGDN keys. CTRL+HOME will go to the
top and CTRL+END will go to the bottom.
You can Find search strings by using CTRL+F. After finding the first occurrence you can find again by pressing F3.
You can also Replace text by using CTRL+H. Highlight a selection of text first if you want to search within that as opposed to all the text in
the component.
Local Variables
In addition to the data you draw from your schematic via
inputs you can also create local variables. These are
defined in exactly the same way as the inputs and outputs.
There is only one type of variable at the moment and that's
a float. This represents a floating point number. As with the
inputs and outputs you need to give the variable a name
and terminate the command with a semicolon.
Variables can be initialised at the same time as you declare
them. You can write:
float x=3;
And x will be assigned the value 3. Variables that are not initialised explicitly will be set to zero.
You can declare multiple variables in a single line of code. For example:
float x,y,z;
Will create three variables x,y and z.
175 of 212