Re: Differences between VB6 and VB.Net causing problem




"Bill McCarthy" <Bill@xxxxxxxxxxxxx> wrote

In VB6, True is a 32 bit value with all bits set.


No it is not. It is 16 bit in Vb6. If you don't beleive the documentation
try it yourself:


Private Type Foo
a As Boolean


Take note, I did not say a Boolean is 32 bits, I said True is 32 bits.
I simply inferred it by noticing that True converted to a Long yields
a 32 bit value.

When you stuff True into a Byte, you only gets 8 bits, and into a
Boolean, (or Integer) you get 16. But stuff it into a Long and you
get 32 bits.

In any case the facts refute your statement:

"Oh, and for the record, VB6 and VB.NET do NOT store 0 and -1"

VB6 actually does use -1 as the value for True as shown when
converted to Currency or Decimal types. And, if I conceed True is
just 16 bits, they use -1 again when converting to a Long type.

As for documentation, in VB5, I put the cursor on "True" and hit
F1 to see this:

"The True keyword has a value equal to -1."

So how is it you say VB6 does not store -1 for True? What do
they store???

LFS


.



Relevant Pages

  • Re: Differences between VB6 and VB.Net causing problem
    ... It is 16 bit in Vb6. ... Take note, I did not say a Boolean is 32 bits, I said True is 32 bits. ... they use -1 again when converting to a Long type. ... Dim bln As Boolean ...
    (microsoft.public.vb.general.discussion)
  • Thanks Re: Control on form like browser
    ... > Dim sRestPath$, sRestPathSplittedAs String, i%, sPathAlready$ ... > documentation for the VB6 versions you have to look them up in the MSDN ... Outgoing mail is certified Virus Free. ...
    (microsoft.public.vb.winapi)
  • Re: Setting based 1 Arrays
    ... Generally I don't have documentation from last century on my PC so no I have no read it. ... some other areas of vb6 are most definately 1 based. ... Which areas are 1 based and which are zero based appears to be random. ... I probably would not have used it in our WCVB.BAS header interface file because it has the explicit lower and upper range defined for the arrays field we have. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Differences between VB6 and VB.Net causing problem
    ... which is why I raised the very issue about not being able to assume the true state is actually equal to -1 is very real. ... First and foremost that assumption has been proven here to be wrong even within VB6 has it not? ... The difference in VB.NET is if you then do a CInt on that compromised boolean you do get -1, so the bitwise operations don't have the same problems. ...
    (microsoft.public.vb.general.discussion)
  • Re: Shared Form - Different Actions for Same Button
    ... I think that really is an issue of different perspectives. ... If you view the documentation as attempting to be complete for those *unfamiliar* with VB6, which is really what documentation should aim to do, then omitting these limitations would be wrong. ... So I could see people from more flexible languages expecting to be able to dynamically add a control, give it a name, then have their Foo_Click handler being called. ...
    (microsoft.public.vb.general.discussion)

Loading