Repository.Variable.GetVariable

Gets the variable with the designated ID number and returns it as a cVariable object. Returns nothing if the variable does not exist or is not in the current project.

Syntax
object.Variable.GetVariable(ID)

where object is a variable that represents a Repository object.

Example
The example assumes that a variable with ID# 1 exists in the repository.

VBA MyRepository Repository AVariable cVariable MyRepository.Project.SetCurrentProject(1) AVariable = MyRepository.Variable.GetVariable(1) VariableName String VariableID Integer VariableName = AVariable.Name VariableID = AVariable.ID MsgBox ( & VariableName &  & VariableID)

VB.NET MyRepository Repository AVariable cVariable MyRepository.Project.SetCurrentProject(1) AVariable = MyRepository.Variable.GetVariable(1) VariableName String VariableID Integer VariableName = AVariable.Name VariableID = AVariable.ID MsgBox ( & VariableName &  & VariableID)