From Clomosy Docs

No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 149: Line 149:
</div>
</div>


<b>TRObject Syntax</b><br>
 
<pre>
<pre>
var
var
Line 172: Line 172:
  ShowMessage(dateOfBirth);
  ShowMessage(dateOfBirth);
}
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
firstName,lastName,age,userWeight,dateOfBirth : String;
begin
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);
end;
</pre>
</pre>


<h2> See Also </h2>
<h2> See Also </h2>
* [[Clomosy_Class#Parameter_Definition_and_Global_Variables | Parameter Definition and Global Variables]]
* [[Clomosy_Class#Parameter_Definition_and_Global_Variables | Parameter Definition and Global Variables]]
{{#seo:|description=Learn how to define and retrieve global parameters in Clomosy projects using the GetProjectUserDefParam function, with examples application.}}

Latest revision as of 11:07, 24 December 2024

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.

When the '+' button is clicked in the Parameters tab, a "Add Param" box appears on the page as shown below.

AddParamV1.0.png

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:

Example
To use the example, a new parameter should be added as shown below.


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);
}

See Also