- Declaring a structure
- Using a structure
How to create and handle a structure?
A structure is a type of variable made of other variables. For example, an "Address" variable can be made of: - Name of my company
- Name of contact
- Address
- Zip code
- City
- Country
This allows you to pass as parameter to a procedure a variable created from a structure instead of passing as many parametes as the number of elements found in the structure. To declare a structure, use the following syntax:
StructureName is structure Member1 is <type of variable> Member2 is <type of variable> ... END
For example:
stAddress is Structure CompanyName is string ContactName is string Address is string PostalCode is string City is string Country is string END
To use an existing structure, you must: - Declare a variable (same type as the structure).
- Initialize the members taking part in the structure.
For example:
stAddress is Structure CompanyName is string ContactName is string Address is string PostalCode is string City is string Country is string END ACustomer is stAddress ACustomer.CompanyName = "PC SOFT" ACustomer.ContactName = "Paul Doe" ACustomer.Address = "3 Rue Puech Villa" ACustomer.ZipCode = "34000" ACustomer.City = "Montpellier" ACustomer.Country = "FRANCE"
Remarks The structures can be declared: - in the project code (structure global to the entire project).
- in the code of a window or page (structure global to the window or page).
- in any process (structure local to the process).
This page is also available for…
|
|
|
|