* MKDATE.PRG PARAMETERS nDy,nMo,nYr, dRet PRIVATE dChk dRet = CTOD(" / / ") dChk = CTOD("1/2/3") DO CASE CASE MONTH(m.dChk)=1 && mm-??-?? IF DAY(m.dChk)=2 && mm-dd-yy dRet = CTOD(ALLTRIM(STR(m.nMo))+"/"+ALLTRIM(STR(m.nDy))+"/"+ALLTRIM(STR(m.nYr))) ELSE && mm-yy-dd dRet = CTOD(ALLTRIM(STR(m.nMn))+"/"+ALLTRIM(STR(m.nYr))+"/"+ALLTRIM(STR(m.nDy))) ENDIF CASE DAY(m.dChk)=1 && dd-??-?? IF MONTH(m.dChk)=2 && dd-mm-yy dRet = CTOD(ALLTRIM(STR(m.nDy))+"/"+ALLTRIM(STR(m.nMo))+"/"+ALLTRIM(STR(m.nYr))) ELSE && dd-yy-mm dRet = CTOD(ALLTRIM(STR(m.nDy))+"/"+ALLTRIM(STR(m.nYr))+"/"+ALLTRIM(STR(m.nMo))) ENDIF OTHERWISE && yy-??-?? IF MONTH(m.dChk)=2 && yy-mm-dd dRet = CTOD(ALLTRIM(STR(m.nYr))+"/"+ALLTRIM(STR(m.nMo))+"/" ALLTRIM(STR(m.nDy))) ELSE && yy-dd-mm dRet = CTOD(ALLTRIM(STR(m.nYr))+"/"+ALLTRIM(STR(m.nDy))+"/"+ALLTRIM(STR(m.nMo))) ENDIF ENDCASEOf course one could create date constructs in FoxPro using the curly-brace notation -- but unfortunately it is dependent on date format (unless you specify caret to denote strict format -- but that was introduced later in FoxPro language). I once demonstrated to the rest of the development staff the dangers date format sensitivity with a series of test programs. I had a several simple programs (it simply returns a date value specified as a date constant with curly-brace notation without using the strict date format) -- all of them were identical, except for date format configuration at the time they were compiled. I than called each of these individual modules from a calling program, then displayed the date values returned -- each program returned a different result (which was dependent on the date format effective at the time they were compiled). Surely you'd say that this is an "impossible" situation that should *never* occur in actual live code. Ah, but what if you've implemented some coding that effectively does a run-time compile? What if you've got code where you perform EVALUATE()?