GetDateLimits PowerScript function
Description
Retrieves the maximum and minimum date limits specified for
the calendar.
Controls
MonthCalendar control
Syntax
|
1 |
<span>controlname</span>.<span>GetDateLimits</span> ( <span>min</span>, <span>max</span> ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the MonthCalendar control |
|
min |
A date value returned by reference that |
|
max |
A date value returned by reference that |
Return Values
Integer. Returns 0 when both limits are
retrieved successfully and one of the following negative values
otherwise:
-
-1
No limits were set
-2
Unknown failure
Usage
Use the SetDateLimits function to set minimum
and maximum dates. If no date limits have been set, GetDateLimits returns
-1 and sets min and max to
January 1, 1900.
Examples
This example displays a message box that shows the
minimum and maximum dates set for a control:
|
1 |
integer li_return<br>Date mindate, maxdate<br>string str1, str2<br> <br>li_return = mc_1.GetDateLimits(mindate, maxdate)<br>If li_return = -1 then<br>   str1 = "No minimum and maximum dates are set"<br>elseif li_return = -2 then<br> str1 = "Unknown failure"<br>else<br>   str1 = "Minimum date is " + string(mindate)<br>   str2 = "Maximum date is " + string(maxdate)<br>end if<br> <br>MessageBox("Date Limits", str1 + "~r~n" + str2) |