View previous topic :: View next topic
|
Author |
Message |
SlippingJimmy
New User
Joined: 21 Sep 2022 Posts: 10 Location: USA
|
|
|
|
It was explained to me struct are similar to classes in Java and can be created and extended to define an "object". I am reading and testing but not sure I understand how structures truly work.
Code: |
dcl 1 person,
2 first_name var char(50),
2 last_name var char(50),
2 is_developer var char(1);
dcl london_emp type person;
dcl ny_emp type person;
|
When I compile
Code: |
ny_emp.first_name = "Joe" |
, I get an error stating
Code: |
the dot qualified reference ny_emp.first_name is unknown |
.
Am I misunderstanding and structs cant be used this way?
Do I need to make a struct for both NY and London? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
Code: |
declare 1 coBorrower like Borrower; |
|
|
Back to top |
|
|
SlippingJimmy
New User
Joined: 21 Sep 2022 Posts: 10 Location: USA
|
|
|
|
sergeyken wrote: |
Code: |
declare 1 coBorrower like Borrower; |
|
I'm not sure I understand what your trying to say. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
SlippingJimmy wrote: |
sergeyken wrote: |
Code: |
declare 1 coBorrower like Borrower; |
|
I'm not sure I understand what your trying to say. |
You have to use LIKE keyword in place of incorrect one: TYPE. |
|
Back to top |
|
|
|