Repository.Variable.GetVariable

Returns a cVariable object, which represents a variable resource. Returns nothing if the variable does not exist or is not in the current project.

Syntax
.Variable.GetVariable(ID)

Parameters
ID
 * Required. Integer. The ID number of the variable to retrieve.

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

VBA MyRepository Repository MyRepository.ConnectToAccessRepository 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 MyRepository.ConnectToAccessRepository AVariable cVariable MyRepository.Project.SetCurrentProject(1) AVariable = MyRepository.Variable.GetVariable(1) VariableName String VariableID Integer VariableName = AVariable.Name VariableID = AVariable.ID  MsgBox ( & VariableName &  & VariableID)