Why use this tutorial?
When Visual Expert analyses your code, some references to dataobjects may be missing.
This may happen in the case of indirect references:
For instance, when passing dataobjects as parameters, or creating variables to store dataobjects name to manipulate them later via this variable.
In such cases, Visual Expert cannot “guess” that a certain parameter is in fact a dataobject, or that a certain string is a dataobject name.
This tutorial will show you how to declare “exceptions”, to instruct Visual Expert how to identify these dataobject and find the missing references.
How to Set DataObject Exceptions in Visual Expert?
Step 1: Identify Missing References
You should identify those dataobjects/datawindows that have no reference yet, although they are used as mentioned above.
- For instance, you can select the root of the DataWindows in the Visual Expert tree view and click on [Possibly Unused Objects].
- Alternatively, you can check a particular PBL:
Select this PBL in the tree view and click on [Possibly Unused Objects].
All DataWindows/DataObjects listed here have no references for now.
If some of them are indeed used via function parameters and/or variables, follow step 2.
Step 2: Create DataObjects Exceptions
Anytime a datawindow is wrongfully listed as 'unused', declare a “Set DataObject Exception”.
- Go to [Settings - More Settings]
- Go to [Project – Exceptions] and click on the [Add] button.
Select “Set DataObject Exception”.
- Enter the details of the DataObject Exception:
- Type of Item raising the exception:
For instance a custom Function with a dataobject name passed as parameter.
Select Custom or System attribute in the case of variable containing a dataobject name.
- Browse your code to select the corresponding function or variable.
Note: In case of a function defined in a function object, select the 'Function Object' before selecting the function.
- For a function, select a parameter passing the datawindow name.
- Save your changes. The new exception appears in the exception list.
Step 3: Update your Code Analysis
- Close the 'Settings' window. Visual Expert will suggest to refresh your Code Analysis.
- Click [Yes].
The code parsers will then take your exception into account.
- New references to DataWindows are now added. The corresponding DataWindows are no longer listed as “unused”.