Dim dteDate as Date
..
.AddNew
!UpdateDateTime = dteDate = Now
..
..
!UpdateDateTime is always returning 12/30/1899 0:00:00
I know this kinda thing works in C++, and I sorta figured it would work in
VB, however, to my surprise, it seems that it doesn't work....
Matt Rutherford
!UpdateDateTime = (dteDate = Now)
translates to:
!UpdateDateTime = False
since dteDate probably doesn't equal Now. The right side is evaluated
and then assigned to the field....
And False = 0, which is the value of the date 12/30/1899 0:00:00.
C++ might have a better chance of working since there's a difference
between '=' and '=='.
--
HTH
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| gHaD (Aaron Robinson) |The Never-Ending Commute|
|Web & Database Developer| Will work for Dew®! |
| Chicago, IL | It pays better... |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Is VB not capable of handing multiple assignments on one line of code?...
Simple answer: no it is not.
Longer answer: VB will never be capable of this because it does not
distinguish between assignment and comparison the way C(++) does with = and
==.
That is of course unless that the people at Microsoft decide to change the
language to make that distinction. What do you think the possibility of that
happening is?
I come from an APL (array-processing) background and so i seriously miss
being able to make multiple assignments and i am finding it a serious
drawback not to have that functionality.
cheui
It's one of those things that you dont realise what you've got till its gone
:(
کک''°؛؛°''ک¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨کک''°؛؛°''کک¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ک''°؛؛°''کک
"If A equals success, then the formula is:
A = X+Y+Z.
X is work. Y is play.
Z is keep your mouth shut."
-Albert Einstein
Well, it's _possible_ anyway:
a = Eq(b, Eq(c, Eq(d, e)))
Function Eq(Var1, Var2)
Var1 = Var2
Eq = Var2
End Function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please post/reply to the
newsgroup(s)
Klaus H. Probst
http://members.xoom.com/kprobst/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Matt Rutherford <matt.l.r...@ccmail.census.gov> wrote in message
news:uo5Z#ELF$GA.230@cppssbbsa05...
> Is VB not capable of handing multiple assignments on one line of code?...
> for example
>
> Dim dteDate as Date
> ..
>
> .AddNew
> !UpdateDateTime = dteDate = Now
> ..
> ..
>
> !UpdateDateTime is always returning 12/30/1899 0:00:00
>
> I know this kinda thing works in C++, and I sorta figured it would work in
> VB, however, to my surprise, it seems that it doesn't work....
>
> Matt Rutherford
>
>
>
>
>
The probability of MS _deliberately_ making a language change that breaks
lots of existing code is almost zero (of course, they do it by accident now
and then). So they'll never _enforce_ the difference between = and ==.
They could conceivably _add_ the new operator == to VB, but that won't solve
the problem that started this thread...
Jim Deutch
MS Dev MVP
a := b := c
RJolt <rj...@iname.com> wrote in message news:u8qorkMF$GA.226@cppssbbsa05...
>
> Jeff Johnson <pawprint@your_clothes.geocities.com> wrote in message
> news:ebVP3wLF$GA....@cppssbbsa02.microsoft.com...
> >
> > Matt Rutherford <matt.l.r...@ccmail.census.gov> wrote in message
> > news:uo5Z#ELF$GA.230@cppssbbsa05...
> >
> > > Is VB not capable of handing multiple assignments on one line of
> code?...
> >
> > Simple answer: no it is not.
> >
> > Longer answer: VB will never be capable of this because it does not
> > distinguish between assignment and comparison the way C(++) does with =
> and
> > ==.
>
In C++, you can say things like x == *(M + **N) || !(**Y / *Z);
In Pascal, you can't.
> Like Jeff
> said, it's because VB has no separate assignment and equality operators,
> unless you count Let <ugh>
A POX ON THEE! Thou hast uttered the forbidden word!
Can you believe there are still people who use this? I mean, talk about
deadwood....
Don't be so surprised... I know of some shops that actually use and *enforce*
Rem as a standard.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeff Johnson wrote in message ...
>