Roboocyte2 JavaScript Documentation
Roboocyte2 Version 1.1.5 2011-11-03
Roboocyte2 scripts
Scripts are written in the Roboocyte2 text editor. They are saved in ASCII format and thus can be
edited also using a standard text editor (like Notepad). It must NOT be opened with a text processing
program like Microsoft Word or Open/Libre Office Writer.
Summary of the Roboocyte2 JavaScript syntax
• JavaScript is case sensitive
• only one statement should be written in one line
• statements should be terminated with a semicolon (';')
• statements can be grouped in code blocks within curly brackets {}
• a commented line starts with // (everything after // is not executed)
• multiline comments start with /* and end with */
• variable names must begin with a letter or an underscore, numbers are allowed within a name,
no other characters, especially no blanks are allowed. Reserved words cannot be used as
variable names
• numbers are either integers (e.g. 420) or floating point numbers (e.g. 3.1). The decimal symbol
must be a dot.
• a string is text within double or single quotes („text2“, 'text2')
• boolean values are true and false
Brief documentation
Here we describe only the most important JavaScript elements, see Further Reading for more detailed
descriptions and references.
For a working example with the Roboocyte2 software see the examples scripts, especially
JavaScript_Example.js
Data types
A value, the data assigned to a variable, may consist of any sort of data. However, JavaScript considers
data to fall into several possible types. Depending on the type of data, certain operations may or may
not be able to be performed on the values. For example, you cannot arithmetically multiply two string
values. Variables can be these types1:
Type Description Example
Integer number integral numbers, negative numbers are prefixed by - 1, -3, 0
floating point number decimal point must be a dot: '.' 3.14,
string text within single or double quotes
„Hello“
1 quoted from: http://www.wdvl.com/Style/JavaScript/Tutorial/variables.html