Re: vb6 question



Well it's not easy, but may be I can write several functions and make a
whole bunch of replacements in the app.

This is my bet: DateSerial (a Vb6 function)

What do you think?

--
Thanks,

Rick.

"For every problem, there is a solution that is simple, neat, and wrong."
H. L. Mencken"


"dpb" wrote:

christery@xxxxxxxxx wrote:
On 2 Apr, 18:38, dpb <n...@xxxxxxx> wrote:
Rick wrote:
Is there any way to make the following date functions:
Format
CDATE
DateAdd
DatePart
Month
Day
...etc...
system date independent?
...

In short, no, I don't believe there's any possibility to change the VB
runtime behavior to make it insensitive to system locale. Your best bet
is to replace the intrinsics w/ your own library functions which are
"app-aware" of local locale.

--

Welll, Excel for example is used to this... why not do like excel?
seconds(?) since 1900-01-01 or something, we use 1980-01-01 for our
origin of time in a DB to get rid of that summertime problem, (got
otherones instead but...)
....

Decent answer to the wrong question I think...that doesn't handle (at
least that I see) the question of interpretation in the VB functions of
a text-formatted date in mm/dd/yy order vis a vis dd/mm/yy order--VB
will still interpret it on the basis of the global locale setting.

What Rick wants/needs is a way to control that behavior for a single app
independent of the system setting and there's no facility in VB to
handle it.

Which, btw, Rick, I agree you need to attach a data item to your app in
some form that is the indicator flag. Not knowing more, I hesitate to
recommend a particular implementation (and you're far more clever/expert
in the environment than I, anyway :) )...

--

.



Relevant Pages

  • LANG, locale, unicode, setup.py and Debian packaging
    ... On start I call locale.setlocale, the getlocale. ... The app assumes unicode objects internally. ... My setup.py also tests locale (because it then loads gettext ... happens if LANG is set to "C", ...
    (comp.lang.python)
  • Re: test if a string is a valid number?
    ... VB is internationalized => soubroutine must take locale into the account. ... Won't require any effort on your part except adding CLR support to your ... not you also want to support postfix sign (which is one of the locale ... 32-bit app on the ...
    (microsoft.public.vc.mfc)
  • Re: Strange behaviour of Str$
    ... Most people would say they are "not locale aware". ... > decimal separator, while the app was running. ...
    (microsoft.public.vb.general.discussion)
  • Re: Problem with locale
    ... If you use your app in Germany, you should have German locale and CDbl ...
    (microsoft.public.vb.syntax)