From Clomosy Docs

In Clomosy projects, the Unit structure is used to organize code into functional and manageable parts. A Unit is a package of code that represents various components and modules within a project. The file extension of a Unit is ".tro".

Some key advantages of the Unit structure include:

  • Modularity and Reusability: Using Units supports a modular code structure, allowing individual components to be developed and tested independently. The same code sections can be reused in different projects or within the same project.
  • Ease of Maintenance and Readability: The Unit structure makes code more organized and readable, simplifying maintenance and development processes.
  • Organization and Management Efficiency: Projects can contain multiple Units, contributing to better organization and a more manageable code structure.

CREATING A UNIT

To create a unit, you must click on the file icon located in the left menu of the code editor.
This will open the "Units" section. When you click the plus (+) icon to create a new unit, a unit addition dialog box will appear on the screen.

CreatingUnitsV1.0.png

In the opened "Add Unit" dialog box, there are fields for entering the 'Unit Name' and 'Unit Language'. In the 'Unit Name' field, for example, enter "uLogin" as the unit name.

Since coding will be done in TRObject language, the 'Unit Language' remains set to TRObject. Finally, click the 'Add' button located at the bottom right corner to create the unit.

AddUnitV1.0.png

When the 'Add' button is clicked, it will be added to the list in the "Units" section.

UnitListV1.0.png

Unit Name Modification and Deletion Operations

Units created within the project can be deleted or renamed. To perform these operations, the following steps should be followed:

  • Click on the "Units" tab in the side menu.
  • To change the name of the unit, click on the settings button (1) next to the unit, and in the dialog that opens, you can modify the unit name and adjust the unit language.
  • To delete the unit, click on the trash can icon (2) located on the same screen.

UnitDeleteAndNameModificationV1.0.png

Methods for Calling a Unit



Uses

The uses keyword defines a list of one or more units that are used by the current unit, program, or library. Each unit is effectively imported, making all public or published routines and data in each unit available for use.



See Also