Purpose
Returns the current date window setting as an integer in the range 0 to 99, or (-1) if date windowing is off. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
DateWindow( context )
context is a SmallInt that can either be DATE_WIN_CURPROG (2) or DATE_WIN_SESSION (1).
Description
This depends on which context is passed. If context is DATE_WIN_SESSION (1), then the current session setting in effect is returned. If context is DATE_WIN_CURPROG (2), then the current MapBasic program's local setting is returned, if a program is not running the session setting is returned.
Example
In the following example the variable Date1 = 19990120, Date2 = 20141203 and MyYear = 2014.
DIM Date1, Date2 as Date
DIM MyYear As Integer
Set Format Date "US"
Set Date Window 75
Date1 = StringToDate("1/20/99")
Date2 = StringToDate("12/3/14")
MyYear = Year("12/30/14")
See Also:
Set Date Window() statement