Remembering Information

Visual LANSA Framework

Remembering Information

Imagine that you had to create a filter like this and needed to remember what the last value entered in the surname field was:

You can do this by using the virtual clipboard.

If you execute this code whenever the surname is entered or changed:

Invoke #AvFrameworkManager.avSaveValue WithID1(SURNAME) FromAValue(#SurName)

 

Then you have saved the current value of #Surname (say, "SMITH") onto the virtual clipboard using the symbolic name SURNAME.

 

To get the value back from the virtual clipboard you do this:

Invoke #AvFrameworkManager.avRestoreValue WithID1(SURNAME) ToAValue(#SurName)
 

 

When you put value "SMITH" onto the clipboard using the symbolic name SURNAME it is accessible to all the other command handlers and filters in your Framework.

Sometimes this is useful because you can pass information around between command handlers and filters.

Sometimes this is not useful and you need to have private information on the clipboard. One way to do this is to use compound symbolic names for information that you put onto the clipboard. If we change the previous  code samples to:

Invoke #AvFrameworkManager.avSaveValue WithID1(*Component) WithID2(SURNAME)

       FromAValue(#SurName)

 

 

Then the symbolic names used to identify "SMITH" on the virtual clipboard are now made up from the current component/function name and the identifier "SURNAME". In other words we have introduced a symbolic object-naming standard that will allow us to use the virtual clipboard in a more organized way.

The best way to learn more about using the virtual clipboard to remember and share information, is to look at the Tutorials and the shipped Programming Techniques application.