VarAssignment

 

Remarks Properties Methods DynProperties Samples

ED
avaliable
RT
read only

Remarks:Top

The routing of the current value of a process variable to a second process variable within a driver or across drivers is implemented with the use of allocations.

Trigger Types:

Value
Name
Description
0
EDGE The allocation is executed each time the value of the linked trigger variable changes from 0 to 1.
1
GAGE The allocation is executed as long as the value of the linked trigger variable is 1.

Properties:Top

ID Name Parent

Methods:Top

ChangeSourceVariable ChangeTargetVariable DynPropertiesEnum[GET]
DynProperties[GET] DynProperties[PUT] ItemSourceVariable
ItemTargetVariable    

DynProperties:Top

Name Type Description
Name String

Name

Unique name of the allocation.
Default: Allocation x (where x is a consecutive number).

ATTENTION: This property is not available for language switching.

Read more in the online manual

SourceVariable ZT_VARIABLE

Source variable

Name of the variable, whose value should be allocated to the target variable.
Opens the variable selection dialog.

Read more in the online manual

TargetVariable ZT_VARIABLE

Target variable

Name of the variable, that the value of the source variable should be allocated to.
Opens the variable selection dialog.

Read more in the online manual

TriggerType Long

Trigger type

Edge: The allocation is executed each time the value of the linked trigger variable changes from 0 to 1.
Gage: The allocation is executed as long as the value of the linked trigger variable is 1.
Default: Edge.

Read more in the online manual

TriggerVariable ZT_VARIABLE

Trigger variable

The bit variable linked here triggers the allocation. If no variable is linked here, the allocation is spontaneous. I.e. whenever the value of the source variable changes, it is automatically written to the target variable.
Opens the variable selection dialog filtered on bit variables.

Read more in the online manual

Samples:Top

'Create a new VarAssignment (Allocation)
Sub CreateAssignment()
Dim zVarAssign As VarAssignment
	'create by NAME
	Set zVarAssign = MyWorkspace.ActiveDocument.VarAssignments.Create("MyAssignment3", "WIZ_VAR_10", "WIZ_VAR_11")
	'change settings
	With zVarAssign
		'set trigger type
		.DynProperties("TriggerType") = 1
		'set trigger variable by Name
		.DynProperties("TriggerVariable") = "MyTrigger"
	End With
End Sub