nrofrows - ObjectVision/GeoDMS GitHub Wiki

Unit functions NrofRows

concept

  • NrofRows() is a function resulting in the number of elements of a domain unit.
  • NrofRows is a property used to configure the number of elements of a domain unit

The first part of this page describes the NrofRows() function, the last paragraph describes the NrofRows property

Names are case insensitive, so nrofrows, NrofRows and NrOfRows all work. Since GeoDMS 20.19.0 the engine registers this name as nrofrows, so that is the spelling it reports back (in DocData(), in error messages) and the one that does not raise a case mix-up warning. Configurations that write NrOfRows keep working but now see that warning once.

syntax

  • NrofRows(domainunit)
  • #domainunit #

definition

NrofRows(domainunit) or #domainunit results in a uint32 parameter with the number of entries/elements (cardinality) of the argument domainunit.

applies to

  • domain unit domainunit with value type of the group CanBeDomainUnit

example

1. parameter<uint32> rowsRegions := nrofrows(Region); // result = 5
2. parameter<uint32> rowsRegions := #RegionDomain;    // result = 5
RegionDomain
0
1
2
3
4

domain Region, nr of rows = 5

see also

property

NrofRows is a property configured for a domain unit, to inform the GeoDMS about the number of elements/entries of the domain. This number is also called the cardinality.

For domain units with data read from external storages or with an expression, the number of elements is read/calculated. So for these domain units this NrOfRows property does not have to be configured.

The range function can be used as an alternative for the NrOfRows property and offers more functionality, for example for non zero based domain units.

configuration

The NrofRows property, due to historical reasons, has a slightly different syntax (no double quotes) than a normal property, see the example

unit<uint8> WeekDays: nrofrows = 7
{
   attribute<string> name : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
}
⚠️ **GitHub.com Fallback** ⚠️