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 determined by the syntax of the code it contains: ".tro" for TRObject syntax and ".base" for Base syntax. These file extensions indicate the syntax in which the code is written and help establish the correct modular structure.
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.
Unit Naming Guidelines:
Paying attention to unit naming conventions can make the coding process more organized and understandable. The following points can help you in this regard:
- Avoid using Turkish characters: Refrain from using Turkish characters (ç, ı, ö, ş, ü) in unit names. Using English characters improves compatibility across different systems and makes your code more portable.
- Do not use spaces between words: Instead of using spaces to separate words in unit names, use camel case or underscores (_). This practice enhances the readability and manageability of the names.
- Prefix with 'u': Adding the letter 'u' at the beginning of a unit name serves as a reminder that this structure is a unit during coding. For example, a name like uEvModeli (or uEv_Modeli) indicates that it is a unit, helping to prevent confusion with other structures.