how to represent int64 in VB? - Page 2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25

Thread: how to represent int64 in VB?

  1. #16
    Jonathan Wood Guest

    Re: how to represent int64 in VB?

    Karl,

    > Close enough. It's a "scaled integer" and works fine for the original

    question.

    It may work for what he wanted but that wasn't really clear to me because he
    didn't indicate what he had to do with them.

    To me, the better approach is to use a combination of longs and, looking at
    your reply to him, looks like you agreed. :-)

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com




  2. #17
    Jonathan Wood Guest

    Re: how to represent int64 in VB?

    Karl,

    > Close enough. It's a "scaled integer" and works fine for the original

    question.

    It may work for what he wanted but that wasn't really clear to me because he
    didn't indicate what he had to do with them.

    To me, the better approach is to use a combination of longs and, looking at
    your reply to him, looks like you agreed. :-)

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com




  3. #18
    Eduardo A. Morcillo Guest

    Re: how to represent int64 in VB?

    You can replace FILETIME with Currency without any harm. Also you can use
    Currency with any function/callback that expects a 64bits interger. The only
    thing you have to do before passing it is divide it by 10000 and multiply it
    by 10000 after receiving it.

    --
    Eduardo A. Morcillo
    http://www.domaindlx.com/e_morcillo
    "Jonathan Wood" <jwood@softcircuits.com> wrote in message
    news:38cd35a8@news.devx.com...
    > Karl,
    >
    > > Close enough. It's a "scaled integer" and works fine for the original

    > question.
    >
    > It may work for what he wanted but that wasn't really clear to me because

    he
    > didn't indicate what he had to do with them.
    >
    > To me, the better approach is to use a combination of longs and, looking

    at
    > your reply to him, looks like you agreed. :-)
    >
    > --
    > Jonathan Wood
    > SoftCircuits Programming
    > http://www.softcircuits.com
    >
    >
    >






  4. #19
    Eduardo A. Morcillo Guest

    Re: how to represent int64 in VB?

    You can replace FILETIME with Currency without any harm. Also you can use
    Currency with any function/callback that expects a 64bits interger. The only
    thing you have to do before passing it is divide it by 10000 and multiply it
    by 10000 after receiving it.

    --
    Eduardo A. Morcillo
    http://www.domaindlx.com/e_morcillo
    "Jonathan Wood" <jwood@softcircuits.com> wrote in message
    news:38cd35a8@news.devx.com...
    > Karl,
    >
    > > Close enough. It's a "scaled integer" and works fine for the original

    > question.
    >
    > It may work for what he wanted but that wasn't really clear to me because

    he
    > didn't indicate what he had to do with them.
    >
    > To me, the better approach is to use a combination of longs and, looking

    at
    > your reply to him, looks like you agreed. :-)
    >
    > --
    > Jonathan Wood
    > SoftCircuits Programming
    > http://www.softcircuits.com
    >
    >
    >






  5. #20
    Karl E. Peterson Guest

    Re: how to represent int64 in VB?

    Hi Jonathan --

    >> Close enough. It's a "scaled integer" and works fine for the original
    >> question.

    >
    >It may work for what he wanted but that wasn't really clear to me because he
    >didn't indicate what he had to do with them.


    I assumed he was using APIs that required a FILETIME structure.

    >To me, the better approach is to use a combination of longs and, looking at
    >your reply to him, looks like you agreed. :-)


    Yep, that's where I go with 'em. Jim Mack, and later (I believe) Bruce McKinney,
    published some cool routines that use Currency instead, so I guess opinions are mixed
    on this one.

    Later... Karl




  6. #21
    Karl E. Peterson Guest

    Re: how to represent int64 in VB?

    Hi Jonathan --

    >> Close enough. It's a "scaled integer" and works fine for the original
    >> question.

    >
    >It may work for what he wanted but that wasn't really clear to me because he
    >didn't indicate what he had to do with them.


    I assumed he was using APIs that required a FILETIME structure.

    >To me, the better approach is to use a combination of longs and, looking at
    >your reply to him, looks like you agreed. :-)


    Yep, that's where I go with 'em. Jim Mack, and later (I believe) Bruce McKinney,
    published some cool routines that use Currency instead, so I guess opinions are mixed
    on this one.

    Later... Karl




  7. #22
    - John of Arc - Guest

    Re: how to represent int64 in VB?

    Aha!

    forgive my ignorance - what are the "low" and "high" parts? first 32 bits
    and second 32-bits?



    Karl E. Peterson <karl@mvps.org> wrote in message
    news:38cd2a7e$1@news.devx.com...
    > Hi John --
    >
    > >How does one represent large numbers like the int64 (e.g. file times) in

    VB?
    >
    > Here's what I use:
    >
    > Private Type FILETIME
    > dwLowDateTime As Long
    > dwHighDateTime As Long
    > End Type
    >
    > You can see a complete example at http://www.mvps.org/vb -- FileInfo.zip

    on the
    > Samples page.
    >
    > Later... Karl
    >
    >
    >




  8. #23
    - John of Arc - Guest

    Re: how to represent int64 in VB?

    Aha!

    forgive my ignorance - what are the "low" and "high" parts? first 32 bits
    and second 32-bits?



    Karl E. Peterson <karl@mvps.org> wrote in message
    news:38cd2a7e$1@news.devx.com...
    > Hi John --
    >
    > >How does one represent large numbers like the int64 (e.g. file times) in

    VB?
    >
    > Here's what I use:
    >
    > Private Type FILETIME
    > dwLowDateTime As Long
    > dwHighDateTime As Long
    > End Type
    >
    > You can see a complete example at http://www.mvps.org/vb -- FileInfo.zip

    on the
    > Samples page.
    >
    > Later... Karl
    >
    >
    >




  9. #24
    Colin McGuigan Guest

    Re: how to represent int64 in VB?

    - John of Arc - wrote in message <38cdca8c$1@news.devx.com>...
    >Aha!
    >
    >forgive my ignorance - what are the "low" and "high" parts? first 32 bits
    >and second 32-bits?



    Yes; if you have a 64 bit number, you can split it into two 32-bit parts (or
    4 16-bit parts, etc, although it's less problematic to use the largest chunk
    possible).

    Mathematically, the low dword (4 bytes) would be your 64 bit number modulo
    2^32, whereas the high dword would be your 64 bit number, integer divided by
    2^32. I don't think the modulo operation in VB (mod) works with numbers
    above 2^31, tho.

    Programmatically, you're better off using CopyMemory.


    --
    Colin McGuigan




  10. #25
    Colin McGuigan Guest

    Re: how to represent int64 in VB?

    - John of Arc - wrote in message <38cdca8c$1@news.devx.com>...
    >Aha!
    >
    >forgive my ignorance - what are the "low" and "high" parts? first 32 bits
    >and second 32-bits?



    Yes; if you have a 64 bit number, you can split it into two 32-bit parts (or
    4 16-bit parts, etc, although it's less problematic to use the largest chunk
    possible).

    Mathematically, the low dword (4 bytes) would be your 64 bit number modulo
    2^32, whereas the high dword would be your 64 bit number, integer divided by
    2^32. I don't think the modulo operation in VB (mod) works with numbers
    above 2^31, tho.

    Programmatically, you're better off using CopyMemory.


    --
    Colin McGuigan




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center