From Clomosy Docs
Below are the headings for different usage structures of syntax used in the Clomosy platform. How each syntax is utilized will be detailed under the respective topics.
- Loops
- Conditions
- Operators
- Error Handling
- Procedure Usage
Every Clomosy program has an execution section in a specific order. The following format shows the basic syntax of a Clomosy program:
const //global constant declaration block var //global variable declaration block function //function declarations, if any //local variables { ... } void //procedure declarations, if any //local variables { ... } { //main program block starts ... } //the end of main program block
TRObject Hello World Example
Following is a simple trobject code that would print the words "Hello, World!"
{ ShowMessage('Hello World!'); }
This will produce following result
Hello World!
Let us look various parts of the above program
- The first line of the program is enclosed by { and } expressions; these form the main program block.
- In Clomosy, each block is surrounded by a start ( { ) expression and an end ( } ) expression. The main program block's start ( { ) expression marks where the program begins executing.
- The statement ShowMessage('Hello, World!'); displays the message "Hello, World!" on the screen using the ShowMessage function available in Clomosy.
- The final expression ( } ) ends your program.
Execute Clomosy Program
- Open the Clomosy developer editor (cms.clomosy.com) and add the code mentioned above.
- Save the program by pressing Ctrl+S or clicking the 'Save' button.
- Download and sign in to the Clomosy Learn application.
- After including the project, click on the project name.
- You will see "Hello World" displayed on the screen, and the program will wait until you press any key.
Block Structure
In the TRObject programming language, block structures are used in various places to organize the logic of the code, manage control flow, and limit specific operations. Here are the common usage areas of block structures in TRObject:
- Main Block
- Procedures and Functions
- Conditional Statements
- Loops
- Error Management
A block structure is defined with curly braces ({...}) in TRObject syntax.
{ ... }