Repository.Project.GetCurrentProject: Difference between revisions
Jump to navigation
Jump to search
Kate Racaza (talk | contribs) No edit summary |
Kate Racaza (talk | contribs) No edit summary |
||
Line 9: | Line 9: | ||
== Example == | == Example == | ||
'''VBA|VB.NET''' | '''VBA|VB.NET''' | ||
{{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository | {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository | ||
{{APIComment|...'Add code to connect to a Synthesis repository.}} | {{APIComment|...'Add code to connect to a Synthesis repository.}} | ||
{{APIComment|'Set the first available project in the repository as the current project.}} | {{APIComment|'Set the first available project in the repository as the current project.}} | ||
MyRepository.Project.SetCurrentProject(1) | MyRepository.Project.SetCurrentProject(1) | ||
{{APIComment|'Output example: | |||
{{APIComment|'Output example: Display the name and ID of the current project.}} | |||
Dim ProjectName {{APIPrefix|As}} String | Dim ProjectName {{APIPrefix|As}} String | ||
Dim ProjectID {{APIPrefix|As}} Integer | Dim ProjectID {{APIPrefix|As}} Integer | ||
ProjectName = MyRepository.Project.GetCurrentProject().Name | ProjectName = MyRepository.Project.GetCurrentProject().Name | ||
ProjectID = MyRepository.Project.GetCurrentProject().ID | ProjectID = MyRepository.Project.GetCurrentProject().ID | ||
MsgBox ({{APIString|"You are currently connected to: "}} & ProjectName & {{APIString|", ID#"}} & ProjectID) | MsgBox ({{APIString|"You are currently connected to: "}} & ProjectName & {{APIString|", ID#"}} & ProjectID) |
Revision as of 16:27, 14 July 2015
Member of: SynthesisAPI10Repository
Returns a NameIDPair object that contains the name and ID number of the project you are currently connected to.
Syntax
object.Project.GetCurrentProject()
where object is a variable that represents a Repository object.
Example
VBA|VB.NET Dim MyRepository As New Repository ...'Add code to connect to a Synthesis repository. 'Set the first available project in the repository as the current project. MyRepository.Project.SetCurrentProject(1) 'Output example: Display the name and ID of the current project. Dim ProjectName As String Dim ProjectID As Integer ProjectName = MyRepository.Project.GetCurrentProject().Name ProjectID = MyRepository.Project.GetCurrentProject().ID MsgBox ("You are currently connected to: " & ProjectName & ", ID#" & ProjectID)