GetTimeByIndex - method of object tvPoints
Returns the time of the nIndex-th data point. Specified value of the index depends on the nIndexType parameter and refers either to the whole buffer or only to the visible part of the buffer.
GetTimeByIndex(nIndex As Long, nIndexType As Long) As Date
t = oPoints.GetTimeByIndex(nIndex, nIndexType)
|nIndex||(Long) Index to the buffer array|
>=0 - index to the buffer array
-2 - the time of the latest data point is returned
|nIndexType||(Long) required type of the returned index|
0 - index refers to the beginning of the buffer
1 - index refers to the first data point that is displayed by the buffer viewer
The method returns the time or Empty if no point has been found.
Let's have the buffer with 100 data points in total, 50 of them are displayed by the viewer and the index of the first displayed point is 7. Suppose that the method finds the first point that suits the vTime time according to nStyle and the index of this point is 10. Then on setting nIndexType to 0 the value on the index 10 is returned, on setting it to 1 the value on the index 3 is returned.