'Usage Dim hours As Integer Dim precision As Byte Dim instance As New TdIntervalHour(hours, precision)
Parameters
- hours
- Number of hours.
- precision
- Number of significant digits of the hour.
'Usage Dim hours As Integer Dim precision As Byte Dim instance As New TdIntervalHour(hours, precision)
Exception | Description |
---|---|
ArgumentOutOfRangeException | The precision parameter is less than the TdIntervalHour.MinPrecision or greater than the TdIntervalHour.MaxPrecision range of values. |
OverflowException | The hours parameter specifies a TdIntervalHour value less than TdIntervalHour.MinValue or greater than TdIntervalHour.MaxValue. |
ArgumentException | The precision parameter is not large enough to represent the number of hours. |
The number of hours is converted into a TdIntervalHour and validated to determine if the TdIntervalHour.MinValue or the TdIntervalHour.MaxValue values have been exceeded. If the values are not exceeded but the resulting hours component exceeds the supplied precision value, an exception is generated.
For example a constructor for TdIntervalHour(444, 2) requests 444 hours with a precision of 2. The resulting hours value cannot be represented in 2 digits, therefore an exception is generated, even though the MinValue and the MaxValue values have not been exceeded.
Negative constructor parameters may be supplied to represent negative durations of time.
Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2