PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Declaring a structure
  • Using a structure
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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 in 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.
Declaring a 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
 ZipCode is string
 City is string
 Country is string
END
Using a structure
To use an existing structure, you must:
  1. Declare a variable (same type as the structure).
  2. Initialize the members taking part in the structure.
For example:
stAddress is Structure
 CompanyName is string
 ContactName is string
 Address is string
 ZipCode 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"
Notes
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).
See The Structure variables for more details.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment