SetVar Method

Action2 Example

 

Encapsulates the AutoMateÖ action in the ôVariablesö group, ôSet variable.ö The method sets a previously created AutoMateÖ variable to the value specified.

 

Declaration

function SetVar (varVarName As Variant,

varNewValue As Variant) As Integer

 

Parameters

varVarName

 The name of the AutoMateÖ variable whose value to change.

 

varNewValue

 The new value of the variable.

 

Description

Use the SetVar method to explicitly set the value of a variable created within AutoMateÖ using the Create Variable step.

 

When the script starts, AutoMateÖ will automatically allocate the variables from your task into the script using the same names from the task. For example, if before the SCRIPT: step in your task you have created a variable called MYVAR, the variable MYVAR will be accessible in your script like any other regular variable. You can safely modify and work with this variable like another other VBA object. When the script ends, AutoMateÖ will automatically write any changes you made to the variable back to the task.

 

If, however, you need to create a NEW variable to be passed back to AutoMateÖ when the script is finished, you will need to create the variable before entering the script by using a Create Variable action. This is because AutoMateÖ can only track those variables that were created before the script started.