locked
integer or int32 RRS feed

  • Question

  • from a Wrox book Professional Visual Basic 2005'

    The main reason to use an Int32 in place of an integer value is to ensure future portability with interfaces.

    For example, the Integer value in Visual Basic 6.0 was limited to a 2-byte value, but is now a

    4-byte value. In future 64-bit platforms, the Integer value will be an 8-byte value. Problems could

    occur if an interface used a 64-bit Integer with an interface that expected a 32-bit Integer value. The

    solution is to use Int32, which would remain a 32-bit value, even on a 64-bit platform.

    The new Integer value type matches the size of an integer value in SQL Server, which means that you

    can easily align the column type of a table with the variable type in your programs.

    My question: If I use int32 then I'm prepared for a 64 bit platform.  On the other hand, I'll be inconsistent with SQL Server.  What's the solution?

    dennist685

    Monday, December 26, 2005 8:35 AM

Answers

  • I'm a little confused as to what this is in relation to, if this is a comparision between using the int (or Integer in VB) keyword over the Int32 type, then this is wrong. These two types are (and will continue to be) the same size, int is simply an alias for System.Int32.
    Sunday, June 4, 2006 10:24 PM