Repository.Profile.GetProfile: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}{{InProgress}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}





Latest revision as of 23:14, 22 March 2017

APIWiki.png


Member of: SynthesisAPI.Repository


Returns a cProfile object that represents a given profile resource in the current project. Returns nothing if the profile does not exist or is not in the current project.


Syntax

Profile.GetProfile(ID)

Parameters

ID

Required. Integer. The ID number of the profile to retrieve.


Example

This example assumes that a profile with ID #1 exists in the first project of a Synthesis repository.

VBA

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11")
 
 'Get profile #1 from project #1. 
  Dim MyProfile As cProfile
  MyRepository.Project.SetCurrentProject(1)
  Set MyProfile = MyRepository.Profile.GetProfile(1)

 'Output sample: Display the name and ID of the profile. 
  Dim ProfileName As String
  Dim ProfileID As Integer
  ProfileName = MyProfile.Name
  ProfileID = MyProfile.ID
  MsgBox ("ID# " & ProfileID & ", " & ProfileName)
VB.NET

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr11")
 
 'Get profile #1 from project #1. 
  Dim MyProfile As SynthesisAPI.cProfile
  MyRepository.Project.SetCurrentProject(1)
  MyProfile = MyRepository.Profile.GetProfile(1)

 'Output sample: Display the name and ID of the profile. 
  Dim ProfileName As String
  Dim ProfileID As Integer
  ProfileName = MyProfile.Name
  ProfileID = MyProfile.ID
  MsgBox ("ID# " & ProfileID & ", " & ProfileName)