Collapse
CollapsingX
  • - or -

Lifetime


Matrox Design Assistant allows you set the lifetime of each variable separately. You can establish whether a variable retains its value between calls to its flowchart, and whether it retains its value after your project is stopped.

Lifetime

When you add or edit a variable, you can set its lifetime. This is typically established by its Reset Point and Persist value properties.

Reset Point is set to NeverReset by default, indicating that the variable is static. Each time you call its flowchart, the variable will retain its value from the flowchart's previous run. You can also set Reset Point to InspectionStart or FlowchartStart. This resets the variable to its initial value at the beginning of the inspection or at the beginning of the flowchart.

For example, consider a numeric variable named TheCount that is initialized to 0 and defined in a subflowchart. TheCount is incremented by1 every time the main flowchart calls this subflowchart. If Reset Point is set to NeverReset, TheCount will remember its previous value every time the subflowchart is called and correctly track how often this happens. If Reset Point is set to InspectionStart or FlowchartStart, TheCount will be initialized to 0 each time the subflowchart is called.

By default variables are initialized when you reset or restart your project, regardless of their Reset Point. To retain a variable's value across project executions, you must set the variable's Persist value property. For more information, see the Persistence and the SavePersistentData step section in Chapter 57: Persistence.