Repository.Variable.AddVariable: Difference between revisions
Jump to navigation
Jump to search
Kate Racaza (talk | contribs) No edit summary |
Kate Racaza (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{Template:APIBreadcrumb|10|Repository}} | {{Template:APIBreadcrumb|10|Repository}} | ||
{{Template:API}} | {{Template:API}} | ||
Saves a new | Saves a new [[CVariable Class|cVariable]] object to the Synthesis repository. Returns a '''Boolean''' value; when true, indicates that the variable now exists in the repository. | ||
== Syntax == | == Syntax == | ||
Line 11: | Line 11: | ||
{| {{APITable}} | {| {{APITable}} | ||
|- | |- | ||
|var{{APIParam|Required}}||The | |var{{APIParam|Required}}||The [[CVariable Class|cVariable]] object to be added. | ||
|} | |} | ||
Line 23: | Line 23: | ||
{{APIComment|'Create a new variable. The following example creates a variable named "MyNewVariable".}} | {{APIComment|'Create a new variable. The following example creates a variable named "MyNewVariable".}} | ||
{{APIPrefix|Dim}} newVariable {{APIPrefix|As New}} cVariable | {{APIPrefix|Dim}} newVariable {{APIPrefix|As New}} cVariable | ||
NewVariable.Name = "MyNewVariable" | NewVariable.Name = {{APIString|"MyNewVariable"}} | ||
{{APIComment|'Add the new variable to project #1. The variable will be visible in the Synthesis repository upon refresh.}} | {{APIComment|'Add the new variable to project #1. The variable will be visible in the Synthesis repository upon refresh.}} | ||
Line 35: | Line 35: | ||
{{APIComment|'Create a new variable. The following example creates a variable named "MyNewVariable".}} | {{APIComment|'Create a new variable. The following example creates a variable named "MyNewVariable".}} | ||
{{APIPrefix|Dim}} newVariable {{APIPrefix|As New}} cVariable ("MyNewVariable") | {{APIPrefix|Dim}} newVariable {{APIPrefix|As New}} cVariable ({{APIString|"MyNewVariable"}}) | ||
{{APIComment|'Add the new variable to project #1. The variable will be visible in the Synthesis repository upon refresh.}} | {{APIComment|'Add the new variable to project #1. The variable will be visible in the Synthesis repository upon refresh.}} | ||
MyRepository.Project.SetCurrentProject(1) | MyRepository.Project.SetCurrentProject(1) | ||
MyRepository.Variable.AddVariable(newVariable) | MyRepository.Variable.AddVariable(newVariable) |
Revision as of 21:22, 16 July 2015
Member of: SynthesisAPI10Repository
Saves a new cVariable object to the Synthesis repository. Returns a Boolean value; when true, indicates that the variable now exists in the repository.
Syntax
object.Variable.AddVariable(var)
where object is a variable that represents a Repository object.
Parameters
Name | Description | |
---|---|---|
varborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder" | ||
Name | Status | The cVariable object to be added. |
Example
VBA
Dim MyRepository As New Repository ...'Add code to connect to a Synthesis repository. 'Create a new variable. The following example creates a variable named "MyNewVariable". Dim newVariable As New cVariable NewVariable.Name = "MyNewVariable" 'Add the new variable to project #1. The variable will be visible in the Synthesis repository upon refresh. MyRepository.Project.SetCurrentProject(1) Call MyRepository.Variable.AddVariable(NewVariable)
VB.NET Dim MyRepository As New Repository ...'Add code to connect to a Synthesis repository. 'Create a new variable. The following example creates a variable named "MyNewVariable". Dim newVariable As New cVariable ("MyNewVariable") 'Add the new variable to project #1. The variable will be visible in the Synthesis repository upon refresh. MyRepository.Project.SetCurrentProject(1) MyRepository.Variable.AddVariable(newVariable)