Component and Property Source Order

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Component and Property Source Order

Post by jyoung »

I stumbled into this today and I never realized or noticed it before, so I just wanted to know if this is the normal behavior.

When defining a property the that has a dynamic reference, does the location of the define_com (in the source) for the component matter?

For example:
When the component is defined before the property
before.png
before.png (5.67 KiB) Viewed 4197 times
but when the component is defined after the property
after.png
after.png (7.06 KiB) Viewed 4197 times
I get an error.

Is this normal? Like I said I've never seen it before.
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Component and Property Source Order

Post by Stewart Marshall »

Hi Joe

The Get portion of the Property definition seems to be OK, but as soon as the Set is added the sequence of the declarations becomes important.

This is perfectly normal, albeit a little strange.

LANSA is quite flexible in where it lets you define certain things, but best practice is always to put declarations above the place where the variable is used.

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply