cProfile.GetSegments

From ReliaWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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)