Repository.Action.GetAllActions: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|10|Repository}}</noinclude>
{{Template:Repository.GetAllActions.Cmt}}


== Syntax==
Gets a list of all existing actions in the current project. Returns a '''[[CAction Class|cAction]]''' object array that contains the action names, ID numbers and other information. 
*GetAllActions() {{APIPrefix|As}} [[cAction Class|cAction]]()
<noinclude>
== Syntax ==
''object''.'''Action.GetAllActions()'''


== Usage Example ==
where ''object'' is a variable that represents a Repository object.
<div style="margin-right: 150px;">
 
  {{APIComment|'Declare a new repository connection object.}}
== Example ==
  Dim MyRepository As New Repository
This example assumes that actions exist in the first available project of a repository.
 
 
  {{APIComment|'Connect to the Synthesis repository.}}
'''VBA|VB.NET'''
  Dim Success As Boolean = False
   
  Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
 
  {{APIComment|...'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Set a first available project as current.}}
   MyRepository.Project.SetCurrentProject(0)
  {{APIComment|'Get a list of all actions in project #1.}}
  {{APIPrefix|Dim}} ListofActions() {{APIPrefix|As}} cAction
   MyRepository.Project.SetCurrentProject (1) 
  ListofActions = MyRepository.Action.GetAllActions()
   
   
  {{APIComment|'Get the list of actions in the current project.}}
  {{APIComment|'Output sample: Display the description and ID# of the first available action in the project.}}
   Dim ListOfActions() As [[cAction Class|cAction]]
   {{APIPrefix|Dim}} ActionName {{APIPrefix|As}} String
   ListOfActions = MyRepository.Action.GetAllActions()
  {{APIPrefix|Dim}} ActionID {{APIPrefix|As}} Integer
</div>
   ActionName = ListofActions(0).ActionDescription
  ActionID = ListofActions(0).ID
  MsgBox (ActionName & ActionID)
</noinclude>

Revision as of 20:58, 16 July 2015

APIWiki.png


Member of: SynthesisAPI10Repository

Gets a list of all existing actions in the current project. Returns a cAction object array that contains the action names, ID numbers and other information.

Syntax

object.Action.GetAllActions()

where object is a variable that represents a Repository object.

Example

This example assumes that actions exist in the first available project of a repository.

VBA|VB.NET

 Dim MyRepository As New Repository
 ...'Add code to connect to a Synthesis repository.   

 'Get a list of all actions in project #1. 
 Dim ListofActions() As cAction
 MyRepository.Project.SetCurrentProject (1)  
 ListofActions = MyRepository.Action.GetAllActions()

 'Output sample: Display the description and ID# of the first available action in the project. 
 Dim ActionName As String
 Dim ActionID As Integer
 ActionName = ListofActions(0).ActionDescription
 ActionID = ListofActions(0).ID
 MsgBox (ActionName & ActionID)