Consultor Eletrônico



Kbase 13124: Code to figure out which date display (-d) is being used.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
Code to figure out which date display (-d) is being used.

Sometimes it is necessary to do date validation. This can become
difficult to code if the end-user sites use different date display
formats. The following code shows one way in which you can
test the current date display. Upon determining the date display,
you can then take the approprate action to check for date valdity,
or what action you require.

/* ------------------------------------------- (c) 1992 Progress Software -- */
/* ---- ---- */
/* ---- Program Name : ts-pqdr.i ---- */
/* ---- Description : Display Routine for personal queue ---- */
/* ---- ---- */
/* ---- Author : P. Gordon ---- */
/* ---- Date Started : 03/10/1991 ---- */
/* ---- Called From : ts-pqlst.p ---- */
/* ---- Calls : n/a ---- */
/* ---- Comments : ---- */
/* ---- ---- */
/* ------------------------------------------------------------------------- */

do:

if ENTRY(LOOKUP(STRING(DATE(1,31,1973)),
"31/01/73,31/73/01,01/31/73,01/73/31,73/31/01,73/01/31"),
"dmy,dym,mdy,myd,ydm,ymd") = "mdy" then do:

/********** if format used for -d startup defaults to "month/day/year" ***/

/* DO YOUR ADDITIONAL CHECKING */

end.
else do: /********** assume day/month/year format **********/

/* DO YOUR ADDITIONAL CHECKING */

end.

Progress Software Technical Support Note # 13124