Click or drag to resize
TOPICA Basic Class RecordCollection

[This is preliminary documentation and is subject to change.]

RecordCollection is a collection of Record objects.

RecordCollection properties

Property

Type

Description

Count

Integer

Number of objects in the collection

Item

TOPICA Basic Class Record

Requires an integer index.

Returns on record at specified position (zero-based).

Record.SubRecords.Item[0] returns the first subrecord.

Record.SubRecords.Item[1] returns the second subrecord.

Note this is same functionality as provided by indexing on the RecordCollection directly.

Record.SubRecords.Item[0] = Record.SubRecords[0]

First

TOPICA Basic Class Record

Returns the first record in the collection.

Last

TOPICA Basic Class Record

Returns the last record in the collection.

ToString

String

Returns a string representation of all records in the collection. The recods are selparated by Newline.

Filter

TOPICA Basic Class RecordCollection

Requires a string index.

Filters the input collection, and returns a collection containing those Record objects, that belong to the table matching the string index.

Example:

Record.SubRecords.Filter["SubTable"]

Returns a collection contating the subrecords beloning to table "SubTable".

ExceptId

TOPICA Basic Class RecordCollection

Requires an integer parameter.

Returns a collection containing the same records as the input collection, except that any record with id equal to the parameter is omitted.

Example:

Record.ParentRecord.SubRecords.Filter[Record.TableName].ExceptId(Record.id)

Returns a collection of "sibling" records, i.e. all records with same parent and same type.

SortDateStartAscending

TOPICA Basic Class RecordCollection

Returns a collection containing the same records as the input collection, sorted by DateStart, ascending.

SortDateStartDescending

TOPICA Basic Class RecordCollection

Returns a collection contating the same records as the input collection, sorted by DateStart, descending.

RecordCollection indexing

RecordCollection supports indexing by numbers (integers) - zero-bases. Index 0 returns first Record in collection, index 1 returns second Record in collection, etc.

Record.SubRecords.Item[0] returns the first subrecord.

Record.SubRecords.Item[1] returns the second subrecord.