Tuesday 1 March 2016

The mkDate predefined function no longer accepts shorthand values

In legacy systems, it was possible to use “shorthand” values for the year argument of the mkDate function. The effect can be seen in the following code sample.
static void Job16(Args _args)
{
  int y;
  date d;
  
  for (y = 0; y < 150; y++)
  {
    d = mkDate(1,1,y);  
    info(strFmt("%1 - %2", y, year(d)));
  }
}
Running this code in the legacy system will produce the following values:
0 – 2000
1 – 2001
2 – 2002

27 – 2027
28 – 2028
29 – 2029
30 – 2030
31 – 1931
32 – 1932
33 – 1933

97 – 1997
98 – 1998
99 – 1999
100 – 1900
We no longer support these values. Attempts to use such values will cause the mkDate function to return the null date (1/1/1900).

No comments:

Post a Comment