From Clomosy Docs
A global variable can be created in the project. To create a global variable, parameters must be defined. These parameters can be used in any desired unit within the project.
The process of creating parameters is located under the "User Defined Params" section on the Application Development Environment page.
When the '+' button is clicked in the Parameters tab, a "Add Param" box appears on the page as shown below.
1
Param Name
The parameter name is being defined. The parameter has multiple data storage fields: (Value Str, Value Text, Value Integer, Value Float, Value Date).
2
Value Str
It represents the field name where string data for the parameter will be stored.
3
Value Text
It represents the field name where long textual data related to the parameter will be added.
4
Value Integer
It represents the field name where numerical data related to the parameter will be added.
5
Value Float
It represents the field name where decimal numerical data related to the parameter will be added.
6
Value Date
It represents the field name where date data related to the parameter will be added.
7
Add Param
After creating the parameter and adding the desired entries to the respective fields, the parameter addition process is completed by clicking the button to perform the addition.
After the parameter registration process is completed, the GetProjectUserDefParam function is used to access this data. The function definition is as follows:
function Clomosy.GetProjectUserDefParam(Param_Name).FieldByName('Field_Name').AsString : String
Example
To use the example, a new parameter should be added as shown below.
Param Name = user_information
Value Str = Alex // first name
Value Text = Dean // last name
Value Integer = 28 // age
Value Float = 85.8 // weight
Value Date = 25.05.1996 // date of birth
Remember!
These parameters cannot be changed while the application is in use. If an update is needed, click on the parameter created in the development environment, modify the values, and then click the add button again.
var
firstName,lastName,age,userWeight,dateOfBirth : String;
{
firstName =
Clomosy.GetProjectUserDefParam('user_information').FieldByName('Value_Str').AsString;
lastName =
Clomosy.GetProjectUserDefParam('user_information').FieldByName('Value_Text').AsString;
age =
Clomosy.GetProjectUserDefParam('user_information').FieldByName('Value_Integer').AsString;
userWeight =
Clomosy.GetProjectUserDefParam('user_information').FieldByName('Value_Float').AsString;
dateOfBirth =
Clomosy.GetProjectUserDefParam('user_information').FieldByName('Value_Date').AsString;
ShowMessage(firstName);
ShowMessage(lastName);
ShowMessage(age);
ShowMessage(userWeight);
ShowMessage(dateOfBirth);
}