CProfile.GetSegments: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
(Created page with '{{DISPLAYTITLE:cProfile.GetSegments}}{{Template:API}}{{Template:APIBreadcrumb|.cProfile}}{{InProgress}} <onlyinclude>Returns an array of [[ProfileSegment Cla…')
 
No edit summary
 
Line 1: Line 1:
{{DISPLAYTITLE:cProfile.GetSegments}}{{Template:API}}{{Template:APIBreadcrumb|.[[CProfile_Class|cProfile]]}}{{InProgress}}
{{DISPLAYTITLE:cProfile.GetSegments}}{{Template:API}}{{Template:APIBreadcrumb|.[[CProfile_Class|cProfile]]}}





Latest revision as of 22:17, 22 March 2017

APIWiki.png


Member of: SynthesisAPI.cProfile


Returns an array of ProfileSegment objects that represent the segments in the profile.

Syntax

.GetSegments()


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 Resource As cProfile
  MyRepository.Project.SetCurrentProject(1)
  Set Resource = MyRepository.Profile.GetProfile(1)

 'Get the profile's segments. 
  Dim ListofSegments() As ProfileSegment
  ListofSegments = Resource.GetSegments

 'Output sample: Display the value of the first segment. 
  MsgBox (ListofSegments(0).Value)
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 Resource As cProfile
  MyRepository.Project.SetCurrentProject(1)
  Resource = MyRepository.Profile.GetProfile(1)

 'Get the profile's segments. 
  Dim ListofSegments() As ProfileSegment
  ListofSegments = Resource.GetSegments

 'Output sample: Display the value of the first segment. 
  MsgBox (ListofSegments(0).Value)