GetSelectedRange
PowerScript function
Description
Retrieves the range of selected dates.
Applies to
MonthCalendar control
Syntax
|
1 |
controlname.GetSelectedRange ( start, end ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the MonthCalendar control for which you want |
|
start |
A date value returned by reference that indicates the |
|
end |
A date value returned by reference that indicates the |
Return value
Integer.
Returns 0 for success, -1 if only one date is selected, and -2 for
an unknown failure.
Usage
If only one date is selected, GetSelectedRange returns -1 and the
selected date is retrieved in the start and end parameters.
Examples
This code in the DateChanged event prompts the user to enter a
second date after the first date in a range is entered, and then asks the
user to confirm the range selected:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
date startdate, enddate integer li_return li_return = mc_1.GetSelectedRange(startdate, enddate) if li_return = -1 then MessageBox("Selected Dates", & "Please select a return date") elseif li_return = 0 then MessageBox("Selected Dates", "You have selected "& + string(startdate) + " - " string(enddate) & + "~r~nClick OK to confirm") else MessageBox("Selected Dates", & "An error has occurred. Please reselect your " & + "travel dates") end if |
See also