[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Date output



On Thu, 5 Aug 1999, Bvk Rao wrote:

> Thanks for your reply. But that's not what I am looking for. I do not
> want to hard code as you did in your example. I want to be able to
> output using the format in the currently selected locale (which I don't
> know beforehand)

>From this, I assume that these reports will be running on different sites
with different "Locale=" settings in the .ini file (since if you used
alter-locale in your program, you would know the locale beforehand).

> and I want to be able to output dates in different
> formats in different reports. For example, if I am using the US-English
> locale, I want to use the mask "Mon DD,YYYY" (the DATE-EDIT MASK for
> this locale) in some reports but I want to use "MM/DD/YYYY"
> (INPUT_DATE_EDIT-MASK) in other reports. The same code should print out
> "DD Mon,YYYY" in the first instance and "DD/MM/YYYY" in the second
> instance if I am using the UK-English locale.

The same code will not print out 2 different formats in 2 different
reports without using different settings of some sort (nor should it).

There is also no way of "getting" the value of a setting in the current
locale.

If you want 2 different formats to print, based on masks in the .ini
files, whenever you use...
   PRINT $datevar DATE
then I would suggest adding a new locale in the sqr.ini files called
ALTERNATE (or whatever you feel like) and on those reports where you want
to use the alternate format (which you DO know ahead of time), add a
   alter-locale
      locale = 'ALTERNATE'
at the top of the code.

If the reports won't be running at multiple sites, and you simply want
mutiple date formats that can be changed easily for "all" reports, the
make an include file that #defines a bunch of date masks, and use these
masks in your reports (giving you one file to change if you want to alter
the formats on all reports).

HTH,
(or is at least close to what you're trying to do).
-----------------------------------------------------------------------
Donald Mellen  | Ray Ontko & Co. - Richmond, IN - http://www.ontko.com/
donm@ontko.com |  "In the beginning, there was nothing, which exploded"