Repository.Profile.GetProfile: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
(Created page with '{{Template:API}}{{Template:APIBreadcrumb|.Repository}}{{InProgress}} <onlyinclude>Returns a '''cProfile''' object that represents a give…')
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}{{InProgress}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}




<onlyinclude>Returns a '''[[CProfile Class|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.</onlyinclude>  
<onlyinclude>Returns a '''[[CProfile Class|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.</onlyinclude>  


== Syntax ==
== Syntax ==
Line 39: Line 40:
    
    
  {{APIComment|'Get profile #1 from project #1.}}
  {{APIComment|'Get profile #1 from project #1.}}
   {{APIPrefix|Dim}} MyProfile {{APIPrefix|As}} cProfile
   {{APIPrefix|Dim}} MyProfile {{APIPrefix|As}} SynthesisAPI.cProfile
   MyRepository.Project.SetCurrentProject(1)
   MyRepository.Project.SetCurrentProject(1)
   MyProfile = MyRepository.Profile.GetProfile(1)
   MyProfile = MyRepository.Profile.GetProfile(1)

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)