If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Why integer and int32

G'day Michael.
>Why do we have both integer and int32 in VB? They seem to do exactly the
>same thing and are completely interchangable.

They *are* exactly the same thing.

I can see no *good anough* reason for keeping both, personally. Perhaps it
is just that Integer has been in BASIC for so long that it is mainly due
to inertia... If Integer was unchanged from VB6, then I would see the value.
However since Integer is in fact now what Long was, breaking compatability
with VB6, it really just serves as a source of occassional, mild, confusion.
After all this time in .Net, still I muck up with Integer and Long sometimes.
No big deal, just a small annoyance.

"Paul Mc" <paulmc@nospam.thehub.com.au> wrote in message
news:3cb4da3f$1@10.1.10.29...
>
> G'day Michael.
>
> >Why do we have both integer and int32 in VB? They seem to do exactly the
> >same thing and are completely interchangable.
>
> They *are* exactly the same thing.
>
> I can see no *good anough* reason for keeping both, personally. Perhaps it
> is just that Integer has been in BASIC for so long that it is mainly due
> to inertia... If Integer was unchanged from VB6, then I would see the
value.
> However since Integer is in fact now what Long was, breaking compatability
> with VB6, it really just serves as a source of occassional, mild,
confusion.
> After all this time in .Net, still I muck up with Integer and Long
sometimes.
> No big deal, just a small annoyance.
>
> Cheers,
> Paul
>
>

Re: Why integer and int32

Re: Why integer and int32

"Michael Culley" <mike@vbdotcom.com> wrote in message
news:3cb4d855@10.1.10.29...
> Why do we have both integer and int32 in VB? They seem to do exactly the
> same thing and are completely interchangable.
>
> --
> Michael Culley
> www.vbdotcom.com
>

Int32 is the underlying type in the .NET framework, whereas Integer is the
'friendly' VB.NET name for it, in exactly the same way that 'int' is the
friendly name in C#.

Re: Why integer and int32

"Michael Culley" <mike@vbdotcom.com> wrote:
>Why do we have both integer and int32 in VB? They seem to do exactly the
>same thing and are completely interchangable.
>
>--
>Michael Culley
>www.vbdotcom.com
>
>

Integer is a keyword in VB language while int32 is .NET framework datatype.
And in VB.NET, VB Integer is traslated into int32. So in VB.ABCD (if it is
there), Integer may get translated to int64 or float32 or something else.

Re: Why integer and int32

Now that that precedent is set, yep. No datatype is safe, anymore.
--
[Microsoft Basic: 1976-2001, RIP]

"Willy Van den Driessche" <wvddwebcomments@skynet.be> wrote in message
news:3cb67aa0@10.1.10.29...
> I would say, int32 will always be 32 bit while integer may become int64 or
> int128 in the long run.
> --
> Van den Driessche Willy
> For a work in progress :
> http://users.skynet.be/wvdd2/index.html
>
>

Re: Why integer and int32

"Integer" has traditionally meant the native word size of a h/w platform (8,
16, 32, or now 64 bits) in my experience.

"Michael Culley" <mike@vbdotcom.com> wrote in message
news:3cb4d855@10.1.10.29...
> Why do we have both integer and int32 in VB? They seem to do exactly the
> same thing and are completely interchangable.
>
> --
> Michael Culley
> www.vbdotcom.com
>
>
>
>
>

Re: Why integer and int32

dnb: In C-based languages, "int" has been the size of the platform's native
word. In MS BASIC dialects on IBM PCs and compatibles, "Integer" has always
been a 16-bit signed integer, regardless of the underlying hardware or OS.
---
Phil Weber

Re: Why integer and int32

Having my roots extend back to PDP-11 Macro-11 and even 8080's and 6502's
before that, the concept of integer operations was a signed or unsigned
value the width of the hardware's ALU.

It was not until C came along that the confusion ran rampant: "WORD", 'int",
"ptr' and dozens of other designations came along that all meant (most of
the time) the same number of bits of storage, turning programming into a
kind of Trivial Pursuit (qv: the off-ramp discussion on case-sensitivity on
compilers).

The size of Integer has always been 16 bits, and it has been
documented that way.

You may be confused by how other languages handle data types. C/C++,
for example, define only the *minimum* size. For example "int" is
defined to be *at least* 16 bits. It is not required to be "native"
size but from what I can tell it generally is.

Re: Why integer and int32

This does not make much sense on modern machines, so VB7 dropped the 16 bit
Integer and went to the 32 bit Integer. This is defined by the language,
not the machine.

Why is that important? When 64 bit machines arrive, an Integer in VB7 will
be 32 bits across all machines, from WinCE machines, to PCs, to Itaniums.
You will be able to run the same code on all three machines without having
to worry about the difference in what the machine considers to be an "Integer."

An Integer in VB will henceforth be 32 bits, until the next major overhaul
of the language.