Assignment for structures
Declaring a structure variable creates an instance of that
structure:
1 |
str_emp_data str_emp1, str_emp2 // Two structure<br>                                 // instances |
When you assign a structure to another structure, the whole
structure is copied and a second copy of the structure data exists:
1 |
str_emp1 = str_emp2 |
The assignment copies the whole structure from one structure
variable to the other. Each variable is a separate instance of the
structure str_emp_data.
Restriction on assignment
If the structures have different definitions, you cannot assign
one to another, even if they have the same set of variable definitions.
For example, this assignment is not allowed:
1 |
str_emp str_person1 |
1 |
str_cust str_person2 |
1 |
str_person2 = str_person1 // Not allowed |
For information about passing structures as
function arguments, see “Passing arguments to functions
and events”.
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest