Origo uses whitespace indentation to identify blocks of statements. The indentation rules are very simple:
Note that the exact amount of indentation does not matter, but the relative amount of indentation of the blocks.
In practice programming, Origo IDE offers assistance by automatically indenting your code by size one tab. By default, the tab size is two whitespaces (as in Example 1),
but you can change it from the Edit/Options.
There in options you can also change to manual indentation. Indenting is not only essential to the compiler, but clarifies the code structure and improves the readability.
The following two examples do exactly same regardless the different amount of indentation:
// In this example the amount of indentation is two whitespaces
main
// Method body is indented
system.run application new MyApplication
// A decrease in indentation signifies the end of the method body
// and the begin of a new code block
class MyApplication extends Application
// Declarations of class methods are indented
draw to <canvas g>
// The method boby further increases the indentation
Size screenSize = screen.get size
int t = system.get running time in milliseconds
if t % 2 == 0
// And the if statement further increases the indentation
g.draw line from 0,0 to screenSize.get width, screenSize.get height color Color.Orange
else
g.draw line from 0,0 to screenSize.get width, screenSize.get height color Color.Magenta
// In this example the amount of indentation is four whitespaces
main
// Method body is indented
system.run application new MyApplication
// A decrease in indentation signifies the end of the method body
// and the begin of a new code block
class MyApplication extends Application
// Declarations of class methods are indented
draw to <canvas g>
// The method boby further increases the indentation
Size screenSize = screen.get size
int t = system.get running time in milliseconds
if t % 2 == 0
// And the if statement further increases the indentation
g.draw line from 0,0 to screenSize.get width, screenSize.get height color Color.Orange
else
g.draw line from 0,0 to screenSize.get width, screenSize.get height color Color.Magenta