Re: question(s) about declaring variables
- From: Duane Bozarth <dpbozarth@xxxxxxxxxxxx>
- Date: Mon, 27 Jun 2005 18:54:21 -0500
Michael C wrote:
>
> "Larry Serflaten" <serflaten@xxxxxxxxxxxxxx> wrote in message
> news:uZE3gAxeFHA.2520@xxxxxxxxxxxxxxxxxxxxxxx
> > Now try it like this:
> >
> > Debug.Print &HDAFF&
> > Debug.Print CLng(&HDAFF)
> >
> > If using CLng was an exact replacement, those two would print the
> > same value, but they don't....
>
> It doesn't have to be an exact replacement as long as you can find a way to
> do what you need. It is possible to never use &.
>
> > The point is you get a Long at compile time using the type definition
> > character, where using the function still involves VB assigning the
> > value to whatever type it deems correct, at compile time. To force
> > VB to use the type you want, those characters are still needed.
>
> Not true. It seems to be a problem with hex values only in a small range. If
> you use decimal values CLng(1000) is identical down to the assembly code to
> 1000&
That "small range" is everything over the magnitude of the largest
positive Integer. Whether it's a problem depends on the context of
whether one wants/needs the resultant Long to be a positive or negative
integer.
.
- Follow-Ups:
- Re: question(s) about declaring variables
- From: Michael C
- Re: question(s) about declaring variables
- References:
- question(s) about declaring variables
- From: Steve Easton
- Re: question(s) about declaring variables
- From: Mike D Sutton
- Re: question(s) about declaring variables
- From: Steve Easton
- Re: question(s) about declaring variables
- From: Mike D Sutton
- Re: question(s) about declaring variables
- From: Larry Serflaten
- Re: question(s) about declaring variables
- From: Michael C
- Re: question(s) about declaring variables
- From: Larry Serflaten
- Re: question(s) about declaring variables
- From: Michael C
- question(s) about declaring variables
- Prev by Date: Re: question(s) about declaring variables
- Next by Date: Re: question(s) about declaring variables
- Previous by thread: Re: question(s) about declaring variables
- Next by thread: Re: question(s) about declaring variables
- Index(es):