CScheduledTask.OnCondGetTeams Method: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 27: Line 27:
   
   
  {{APIComment|'Create instance of TeamInfo if on condition task}}
  {{APIComment|'Create instance of TeamInfo if on condition task}}
   {{APIPrefix|If}} aTask.TaskClass = OnCondition {{APIPrefix|Then}}
   {{APIPrefix|If}} aTask.TaskClass = TaskClassEnum_OnCondition {{APIPrefix|Then}}
      {{APIPrefix|Dim}} Teams() {{APIPrefix|As}} TeamInfo
    {{APIPrefix|Dim}} Teams() {{APIPrefix|As}} TeamInfo
      {{APIPrefix|Set}} Teams = aTask.OnCondGetTeams
    {{APIPrefix|Call}} aTask.OnCondGetTeams(Teams)
   {{APIPrefix|End If}}
   {{APIPrefix|End If}}

Latest revision as of 18:27, 14 March 2019

APIWiki.png


Member of: SynthesisAPI.cScheduledTask


Returns an array teams required for the 'On condition' task.


Remarks: Designed for VB6/VBA users, but can also be used in .NET. Alternatively, .NET users can use the OnCondTeams() property in the class to get or set the teams.

Syntax

.OnCondGetTeams(ByRef arr())

Parameters

arr()

Required as TeamInfo. An array of the team IDs for the task.

Example

VBA

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr19")
  MyRepository.Project.SetCurrentProject(1)

 'Get a particular task with ID of 2 from repository. 
  Dim aTask As cScheduledTask
  Set aTask = MyRespository.Task.GetScheduledTask(2)

 'Create instance of TeamInfo if on condition task 
  If aTask.TaskClass = TaskClassEnum_OnCondition Then
    Dim Teams() As TeamInfo
    Call aTask.OnCondGetTeams(Teams)
  End If