Repository.Crew.AddCrew: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:APIBreadcrumb|10|Repository}}
{{Template:Repository.AddCrew.Cmt}} {{Template:BooleanReturn.Cmt}}
{{Template:API}}
Saves a new [[CCrew Class|cCrew]] object to the Synthesis repository. Returns a '''Boolean''' value; when true, indicates that the crew now exists in the repository.  


==Syntax==
== Syntax ==
*AddCrew( crew {{APIPrefix|As}} [[cCrew Class|cCrew]] ){{APIPrefix|As Boolean}}
''object''.'''Crew.AddCrew(''crew'')'''


Parameters
where ''object'' is a variable that represents a Repository object.
:''crew'': The [[cCrew Class|cCrew]] to add.


== Usage Example ==
=== Parameters ===
  {{APIComment|'Declare a new repository connection object.}}
{| {{APITable}}
   Dim MyRepository As New Repository
|-
    
|crew{{APIParam|Required}}||The [[CCrew Class|cCrew]] object to be added
  {{APIComment|'Connect to the Synthesis repository.}}
|}
   Dim Success As Boolean = False
 
   Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
 
    
== Example ==
  {{APIComment|'Set a first available project as current.}}
'''VBA'''
  MyRepository.Project.SetCurrentProject(0)
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
{{APIComment|...'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Create a new crew. The following example creates a crew named "MyNewCrew".}}
   {{APIPrefix|Dim}} NewCrew {{APIPrefix|As New}} cCrew
   NewCrew.Name = {{APIString|"MyNewCrew"}}
  {{APIComment|'Add the new crew to project #1. The crew will be visible in the Synthesis repository upon refresh.}}
   MyRepository.Project.SetCurrentProject(1) 
   {{APIPrefix|Call}} MyRepository.Crew.AddCrew(NewCrew)
 
'''VB.NET'''
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...'Add code to connect to a Synthesis repository.}}
{{APIComment|'Create a new crew. The following example creates a crew named "MyNewCrew".}}
  {{APIPrefix|Dim}} NewCrew {{APIPrefix|As New}} cCrew ({{APIString|"MyNewCrew"}})
   
   
  {{APIComment|'Declare a new crew.}}
  {{APIComment|'Add the new crew to project #1. The crew will be visible in the Synthesis repository upon refresh.}}
  Dim newCrew As New cCrew("NewCrew1")
   MyRepository.Project.SetCurrentProject(1) 
 
   MyRepository.Crew.AddCrew(NewCrew)
{{APIComment|'Add the crew to the repository.}}
   Dim SuccessAddCrew As Boolean
   SuccessAddCrew = MyRepository.Crew.AddCrew(newCrew)

Revision as of 21:19, 16 July 2015

Member of: SynthesisAPI10Repository

APIWiki.png


Saves a new cCrew object to the Synthesis repository. Returns a Boolean value; when true, indicates that the crew now exists in the repository.

Syntax

object.Crew.AddCrew(crew)

where object is a variable that represents a Repository object.

Parameters

Name Description
crewborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status The cCrew object to be added


Example

VBA

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

 'Create a new crew. The following example creates a crew named "MyNewCrew". 
 Dim NewCrew As New cCrew
 NewCrew.Name = "MyNewCrew"

 'Add the new crew to project #1. The crew will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 Call MyRepository.Crew.AddCrew(NewCrew)
VB.NET

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

 'Create a new crew. The following example creates a crew named "MyNewCrew". 
 Dim NewCrew As New cCrew ("MyNewCrew")

 'Add the new crew to project #1. The crew will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 MyRepository.Crew.AddCrew(NewCrew)