Check that Reference Has Been Destroyed

Visual LANSA

Check that Reference Has Been Destroyed

A simple test to verify that references have been destroyed is to put this line of code immediately after setting the reference to AddressForm to *NULL:

 

INVOKE method(#AddressForm.u_GetDetails) U_WITHEMPNO(#EMPNO) U_WITHSURNAME(#SURNAME)

 

It will attempt to reference the instance of AddressForm, but will find nothing.  The application will then crash as it cannot find what it is looking for:

 

Note

The fact that the application crashes when the object it tries to reference does not exist should alert you to the fact  that if you go down the route of controlling the life of child and related forms, you must do it completely.  LANSA shields the developer from a lot of the complexity of writing OO Windows applications, and many of the difficult procedures required in for example C and C++ are avoided.  If you start controlling the life of components, you have to be aware of the implications.

That being said, controlling references is often required in complex and efficient windows applications.

Ý 6.23.1 Dynamic Multi-Form Application