DataLengthArray

Purpose
This property is used to determine the length of data in a specified record.

Syntax (Read-Only Property)
Long = object.DataLengthArray(Key, Instance)

Parameters
Key (String)   This is the key of the record you want to work with.
Instance (Long)  

This is the instance of the record named with the specified key you want to work with.

Key and Instance work together to specify a record. For example, if Instance is 3, then the property specifies the 4th (zero-based) record that is named Key.

This parameter is zero-based.

Negative values are bound to zero (0).


Return Value
Long (Long)   This is the length of the data in the specified record.

Notes
If the specified record exists, then the length of the data in the specified record is returned as a long.

If the specified record does not exist, the function returns a zero (0)

Error Values
This property does not change the state of the ErrorNumber property.

Example
Objective: Add a record to the database and return its length.

'Create a database
Dim CDP As rtCDP.rtCompactDataPak
Set CDP = New
rtCDP.rtCompactDataPak
'Add a record to the database
CDP.DataArray("Band", 3) = "Journey"
'Get the length of the new record's data
Dim DataLen As Long
DataLen = CDP.DataLengthArray("Band", 3) 'DataLen equals 7
'Now get the length of a non-existent record
DataLen = CDP.DataLengthArray("Band", 4) 'DataLen equals 0
'Now get the length of a record with no data
DataLen = CDP.DataLengthArray("Band", 0) 'DataLen equals 0

Version History
1.0 2/1/2001 Tested

See Also
DataLength, DataLengthRec