User Guide
Ruby Component
Code Editor Basics
The code editor is where all the action happens. This is where you type in your Ruby code, have it process the input data and send any
results to the output(s).
The editor has syntax colouring to make code more readable. It supports all the operations you'd expect including cut, copy and paste
(CTRL+X, CTRL+C and CTRL+V), automatic scroll bars and mouse wheel scrolling.
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 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.
We have used the fact that Ruby is an extendable language to implement a number of FlowBotics Studio specific classes and keywords. We
have also defined a collection of methods that you can implement in your code so that it can more tightly integrate with FlowBotics Studio.
The rest of this section assumes you know what Ruby is and have a basic understanding of what a Ruby class, method and variable is.
The Output Pane
Before we get into the nitty gritty, a quick word about the Output Pane.
The code editor and output pane work together. Any errors or output from the code you type in the editor are displayed in the output pane.
For example, you can type any valid mathematical expression into the Ruby component and the evaluated result is shown in the output
pane.
The example above shows 10 as the result of 2*3+4.
Type in an invalid expression or any syntax that causes an error and you'll get an error message instead. Note that only the first error
encountered is displayed.
102 of 212