GetDateLimits

Description

Retrieves the maximum and minimum date limits specified for the calendar.

Applies to

MonthCalendar control

Syntax

controlname.GetDateLimits ( min, max )

Argument

Description

controlname

The name of the MonthCalendar control for which you want to determine the date limits

min

A date value returned by reference that represents the minimum date that can be referenced or displayed in the calendar

max

A date value returned by reference that represents the maximum date that can be referenced or displayed in the calendar


Return value

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:

integer li_return
Date mindate, maxdate
string str1, str2

li_return = mc_1.GetDateLimits(mindate, maxdate)
If li_return = -1 then
   str1 = "No minimum and maximum dates are set"
elseif li_return = -2 then
   str1 = "Unknown failure"
else
   str1 = "Minimum date is " + string(mindate)
   str2 = "Maximum date is " + string(maxdate)
end if

MessageBox("Date Limits", str1 + "~r~n" + str2)

See also

SetDateLimits