- Benjamin Gaesslein
- PowerBuilder
- Friday, 29 January 2021 02:07 PM UTC
Let's say you have a nonvisual, non-autoinstantiated custom object called n_object, which has a private member variable long il_private.
Now let's say there's a scenario where a function of n_object needs to create another instance of type n_object, possibly using a dynamically generated name of an object inherited from n_object itself. Like:
n_object lnv_inherited
lnv_inherited = create using of_getnameofinheritedobject()
It is now possible to directly assign a value to il_private of the freshly created instance:
//compiles without errors and works at runtime
lnv_inherited.il_private = 5
Private functions are accessible as well. I'm not sure wether or not this is "bad" per se but it's certainly not the behavior I would've expected. Any thoughts?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.