How does one represent large numbers like the int64 (e.g. file times) in VB?
Thanks.
Printable View
How does one represent large numbers like the int64 (e.g. file times) in VB?
Thanks.
John <snip>,
> How does one represent large numbers like the int64 (e.g. file times) in
VB?
The short answer is that VB doesn't support 64 bit integers.
You could probably come up with a way to represent them using a Byte or Long
array. For some tasks, using the Decimal data type of a variant might work.
It depends on what you need to do with that int64.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
John <snip>,
> How does one represent large numbers like the int64 (e.g. file times) in
VB?
The short answer is that VB doesn't support 64 bit integers.
You could probably come up with a way to represent them using a Byte or Long
array. For some tasks, using the Decimal data type of a variant might work.
It depends on what you need to do with that int64.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
If you are passing by reference pass the first long of a long array of two
elements eg
dim l(1 to 2) as long
call someroutine(l(1))
BUT don't forget the number will come back reversed
so if you had a value 1 in the 64 bit number hex H00000000 00000001
it will come back as
l(1) = H00000001
l(2) = H00000000 !!!!!!!
BTW if you are J of A does it mean us English have got to burn you again - is
that what you understand by a flame? :-)
Anton
- John of Arc - wrote:
> How does one represent large numbers like the int64 (e.g. file times) in VB?
>
> Thanks.
--
Anton Britten
EMail :- anton@brittena.demon.co.uk
or AntonBritten@compuserve.com
Web site :- www.brittena.demon.co.uk
Anton Britten Computing Ltd
You find sympathy in the dictionary
- between sh*t and syphilis !
If you are passing by reference pass the first long of a long array of two
elements eg
dim l(1 to 2) as long
call someroutine(l(1))
BUT don't forget the number will come back reversed
so if you had a value 1 in the 64 bit number hex H00000000 00000001
it will come back as
l(1) = H00000001
l(2) = H00000000 !!!!!!!
BTW if you are J of A does it mean us English have got to burn you again - is
that what you understand by a flame? :-)
Anton
- John of Arc - wrote:
> How does one represent large numbers like the int64 (e.g. file times) in VB?
>
> Thanks.
--
Anton Britten
EMail :- anton@brittena.demon.co.uk
or AntonBritten@compuserve.com
Web site :- www.brittena.demon.co.uk
Anton Britten Computing Ltd
You find sympathy in the dictionary
- between sh*t and syphilis !
> The short answer is that VB doesn't support 64 bit integers.
But it has a 64bits type: Currency.
--
Eduardo A. Morcillo
http://www.domaindlx.com/e_morcillo
> The short answer is that VB doesn't support 64 bit integers.
But it has a 64bits type: Currency.
--
Eduardo A. Morcillo
http://www.domaindlx.com/e_morcillo
Thanks for the technique.
I'm trying to handle file times, to be more specific.
Anton Britten <AntonBritten@compuserve.com> wrote in message
news:38CB5F2C.5890DC91@compuserve.com...
> If you are passing by reference pass the first long of a long array of two
> elements eg
>
> dim l(1 to 2) as long
>
> call someroutine(l(1))
>
> BUT don't forget the number will come back reversed
>
> so if you had a value 1 in the 64 bit number hex H00000000 00000001
>
> it will come back as
>
> l(1) = H00000001
> l(2) = H00000000 !!!!!!!
>
> BTW if you are J of A does it mean us English have got to burn you again -
is
> that what you understand by a flame? :-)
>
> Anton
>
> - John of Arc - wrote:
>
> > How does one represent large numbers like the int64 (e.g. file times) in
VB?
> >
> > Thanks.
>
> --
>
> Anton Britten
>
> EMail :- anton@brittena.demon.co.uk
> or AntonBritten@compuserve.com
>
> Web site :- www.brittena.demon.co.uk
>
> Anton Britten Computing Ltd
> You find sympathy in the dictionary
> - between sh*t and syphilis !
>
>
Thanks for the technique.
I'm trying to handle file times, to be more specific.
Anton Britten <AntonBritten@compuserve.com> wrote in message
news:38CB5F2C.5890DC91@compuserve.com...
> If you are passing by reference pass the first long of a long array of two
> elements eg
>
> dim l(1 to 2) as long
>
> call someroutine(l(1))
>
> BUT don't forget the number will come back reversed
>
> so if you had a value 1 in the 64 bit number hex H00000000 00000001
>
> it will come back as
>
> l(1) = H00000001
> l(2) = H00000000 !!!!!!!
>
> BTW if you are J of A does it mean us English have got to burn you again -
is
> that what you understand by a flame? :-)
>
> Anton
>
> - John of Arc - wrote:
>
> > How does one represent large numbers like the int64 (e.g. file times) in
VB?
> >
> > Thanks.
>
> --
>
> Anton Britten
>
> EMail :- anton@brittena.demon.co.uk
> or AntonBritten@compuserve.com
>
> Web site :- www.brittena.demon.co.uk
>
> Anton Britten Computing Ltd
> You find sympathy in the dictionary
> - between sh*t and syphilis !
>
>
Currency is not an integer type.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Eduardo A. Morcillo" <edanmo@geocities.com> wrote in message
news:38cb7ec1@news.devx.com...
> > The short answer is that VB doesn't support 64 bit integers.
>
> But it has a 64bits type: Currency.
>
> --
> Eduardo A. Morcillo
> http://www.domaindlx.com/e_morcillo
>
>
Currency is not an integer type.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
"Eduardo A. Morcillo" <edanmo@geocities.com> wrote in message
news:38cb7ec1@news.devx.com...
> > The short answer is that VB doesn't support 64 bit integers.
>
> But it has a 64bits type: Currency.
>
> --
> Eduardo A. Morcillo
> http://www.domaindlx.com/e_morcillo
>
>
Hi Jonathan --
>Currency is not an integer type.
Close enough. It's a "scaled integer" and works fine for the original question.
Later... Karl
Hi Jonathan --
>Currency is not an integer type.
Close enough. It's a "scaled integer" and works fine for the original question.
Later... Karl
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
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