Remembering Information on the Clipboard

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:


#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 logically 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)


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.