Re: VB5 Long & Double to VB.NET



Cor,

The variable size of the "C/C++" int data type has, over the years, caused
almost as many problems for programmers as buffer overruns. Defining the
size is actually a good thing, so long as you have other numeric data types
that work like int but allow full access to the processor word length.

Mike.

"Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx> wrote in message
news:urgVxdyPHHA.3944@xxxxxxxxxxxxxxxxxxxxxxx
Armin,

Even Herfried is now advising to use the Int32 in API's.

I find it one of the stupidest decisions to let the Integer not to be the
same as the internal size of an accumulator. If that was than most
programs would benefit from the performance enhancements without
rewriting, rebuilding is than enough. However I thought it was the VB6
lobby which forces us now to change all integers in Int64 and latter
probably in Int128.

Cor

"Armin Zingler" <az.nospam@xxxxxxxxxx> schreef in bericht
news:ev6jA1uPHHA.4364@xxxxxxxxxxxxxxxxxxxxxxx
"Fabio Z" <znt.fabio@xxxxxxxxxxx> schrieb
"Terry" <news-grps@xxxxxxxxxxxxxxxxxxxxxxxx> ha scritto nel
messaggio

Thanks for the help. Long to int32 did the trick. As I am
calculating astrological positions I find that there are some
small differences between the Access VBA results and VB.NET for
the Sun and Moon of a couple of arc seconds each that I will need
to check out, apart from that all is working out just fine now.
It's great to finally get my first VB.NET solution working thanks.

I suggest to don't tie to language-specific data type.
Instead of ambiguos Integer (vb6/vb.net) or int (c#) for extern dll
calls use Int32 that tell you immediatly that you are working with a
32 bit integer.


Do you think, Integer will change in future again? Even if you target
Win64, Integer is still Int32. Just curious.


Armin




.



Relevant Pages

  • Re: Use of Long and Long Long
    ... unjustfied concern with the layout of data types is a sign of inexperience. ... in some languages even the properties of data ... it wouldn't matter one iota. ... that some programmers aren't bothered by this aspect of C ...
    (comp.lang.c)
  • problems with Java
    ... many of these tools have been misused by programmers in other ... First is the lack of operator overloading. ... The core of OOP is being able to make customized data types with built ... inheritance as there are many times when data types should inherit. ...
    (comp.lang.java.programmer)
  • Re: Which is better, C# or VB, and why?
    ... C# can use the unsigned integer data types, and you can code 'unsafe' code ... VB does background compiles and is quicker at showing you coding errors ... There's a contingent of C# programmers who tend to look down their noses at ... science background should be able to pick up a new language in no more than ...
    (microsoft.public.dotnet.general)
  • Re: VB6 and Microsoft and what to do about it.
    ... > VB.NET emits IL to declare a int32 every time it sees a integer, ... > The two langauge has little things that work in their favor. ... > in a different language. ... > getting programmers up to speed if they come only knowing about the ...
    (microsoft.public.vb.general.discussion)
  • Re: Java Float newbie problem
    ... The book "JAVA for Programmers" Douglas A. Lyon makes a distinction ... between primitive data types and reference data types. ... since JAVA does not support programmer defined operator ...
    (comp.lang.java.help)