Encapsulates the AutoMateÖ action in the ôVariablesö group, ôCreate variable.ö The method creates a new variable for use in an AutoMateÖ task.
Declaration
function CreateVar (varVarName As Variant,
varInitialValue As Variant) As Integer
Parameters
varVarName
The name of the AutoMateÖ variable to create.
varInitialValue
The new variableÆs initial value.
Description
Use the CreateVar method to create a new AutoMateÖ variable that can be accessed and modified within the currently executing AutoMateÖ task.
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 use the CreateVar method to first create the variable, and explicitly set any changes to the variable using the SetVar method. This is because AutoMateÖ can only track those variables that were created before the script started.