Repository.Unit.GetAllUnits: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:




<onlyinclude>Gets the unit of measurement associated with a [[Repository_Class|Repository]] object. Returns a '''[[UnitInfo Class|UnitInfo]]''' object that represents the unit of measurement.</onlyinclude>
<onlyinclude>Gets an array of '''[[UnitInfo Class|UnitInfo]]''' objects that represent the units of measurement associated with a Repository object.</onlyinclude>


== Syntax ==
== Syntax ==

Revision as of 23:01, 8 June 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Gets an array of UnitInfo objects that represent the units of measurement associated with a Repository object.

Syntax

.Unit.GetAllUnits()


Example

VBA|VB.NET

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
  
 'Get a list of all defined units in the repository. 
  Dim ListOfUnits() As UnitInfo
  ListOfUnits = MyRepository.Unit.GetAllUnits()

 'Output sample: Display the number of elements in the array. 
  Dim NumberofElements As Integer
  NumberofElements = UBound(ListofUnits) - LBound(ListofUnits) + 1
  MsgBox (NumberofElements)