PowerBuilder 10.5
Apparently, in a function I cannot pass an argument of the base type NonVisualObject. I can pass a argument that is of type UserObject, but that’s not what I’m looking for. I created a simple NonVisualObject as means of a DTO (Data-Transfer-Object) to pass simple data to my function.
Any ideas on how to pass a type of NonVisualObject to my function?
Are you are looking in the dropdown list for the argument type? You can type any valid class name in those boxes.
If you declare the parameter as
nonvisualobjectthe function won’t have access to any of the properties you added to your object*. You should declare the parameter as the class name you gave your NonVisualObject (see #1).*It’s possible to cast the argument to the correct type within the function but you should have a very good reason to pass an ancestor and cast to a descendant. Doing so safely is an advanced technique.