Repository.Pool.AddPool: 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.AddPool.Cmt}} {{Template:BooleanReturn.Cmt}}


==Syntax==
Saves a new [[CPool Class|cPool]] object to the Synthesis repository. Returns a '''Boolean''' value; when true, indicates that the spare part pool now exists in the repository.
*AddPool( pool {{APIPrefix|As}} [[cPool Class|cPool]] ) {{APIPrefix|As Boolean}}
<noinclude>
== Syntax ==
''object''.'''Pool.AddPool(''pool'')'''


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


== Usage Example ==
=== Parameters ===
  {{APIComment|'Declare a new repository connection object.}}
{| {{APITable}}
   Dim MyRepository As New Repository
|-
    
|pool{{APIParam|Required}}||The [[CPool Class|cPool]] 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 pool. The following example creates a pool named "MyNewSpares".}}
   {{APIPrefix|Dim}} NewSpares {{APIPrefix|As New}} cPool
   NewSpares.Name = {{APIString|"MyNewSpares"}}
  {{APIComment|'Add the new spare part pool to project #1. The spare part pool will be visible in the Synthesis repository upon refresh.}}
   MyRepository.Project.SetCurrentProject(1) 
   {{APIPrefix|Call}} MyRepository.Pool.AddPool(NewSpares)
 
'''VB.NET'''
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...'Add code to connect to a Synthesis repository.}}
{{APIComment|'Create a new pool. The following example creates a pool named "MyNewSpares".}}
  {{APIPrefix|Dim}} NewSpares {{APIPrefix|As New}} cPool ({{APIString|"MyNewSpares"}})
   
   
  {{APIComment|'Declare a new pool.}}
  {{APIComment|'Add the new spare part pool to project #1. The spare part pool will be visible in the Synthesis repository upon refresh.}}
  Dim newPool As New cPool("NewPool1")
   MyRepository.Project.SetCurrentProject(1) 
 
   MyRepository.Pool.AddPool(NewSpares)
{{APIComment|'Add the pool to the repository.}}
</noinclude>
   Dim SuccessAddPool As Boolean
   SuccessAddPool = MyRepository.Pool.AddPool(newPool)

Revision as of 21:30, 16 July 2015

APIWiki.png


Member of: SynthesisAPI10Repository

Saves a new cPool object to the Synthesis repository. Returns a Boolean value; when true, indicates that the spare part pool now exists in the repository.

Syntax

object.Pool.AddPool(pool)

where object is a variable that represents a Repository object.

Parameters

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


Example

VBA

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

 'Create a new pool. The following example creates a pool named "MyNewSpares". 
 Dim NewSpares As New cPool
 NewSpares.Name = "MyNewSpares"

 'Add the new spare part pool to project #1. The spare part pool will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 Call MyRepository.Pool.AddPool(NewSpares)
VB.NET

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

 'Create a new pool. The following example creates a pool named "MyNewSpares". 
 Dim NewSpares As New cPool ("MyNewSpares")

 'Add the new spare part pool to project #1. The spare part pool will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 MyRepository.Pool.AddPool(NewSpares)