Back

Topic

[KB116]Properties linked to temporary variables

Tags: Animations

14 years ago
By RM
Options
Print
Applies to:

PcVue version 8.00 onwards.


Summary:

This article describes how temporary variables can be linked to the properties of drawing elements to produce animation effects.


Details:

Variable

In PcVue, most animations (color state, text, register) require a variable of a particular type (Bit, Register or Text). However if you apply the ‘Variables Link’ feature to a drawing element, it does not specify any particular type of variable (i.e. right-click on the element, select Properties List, open Variables Link, choose a property such as Width and type a name for a new temporary variable beside it).

Properties_List_dialog_link_to_temp_variable

Properties_List_dialog_link_to_temp_variable2

Since the type is predetermined in the case of Link to Variable, it will cause a Type Mismatch error if used where a Register or Text variable is required.

Expression

In a similar way:

Properties_List_dialog_link_to_temp_variable3

Since the type is predetermined in the case of Link to Variable, it will cause a Type Mismatch error if used where a Bit or Text variable is required.

Solution

To force the type of the temporary variable used in the Link to Variable property, you must use one of these workarounds to create suitable temporary variables in advance:

  • In VBA, create temporary variables with suitable types when the project starts, e.g.:

Variables.Add “VarName%”, fvVariableTypeBit

  • Create a transparent object with animations that refer to the required variables. For example, if you need an expression or temporary variable of type Bit then add a Color.Bit animation that uses the desired expression or temporary variable.

Note

Put the invisible object in a mimic (e.g. a menu) that is opened automatically, so that it will be loaded before the variables or expressions are used.


Created on: 05 Nov 2010 Last update: 13 May 2024