BBS: Inland Empire Archive
Date: 10-29-92 (12:15) Number: 320
From: TONY ELLIOTT Refer#: NONE
To: WARREN SCHREY Recvd: NO
Subj: Re: hm. Conf: (2) Quik_Bas
WS> Why does this work?
WS> where this
WS> <Overflow Error>
WS> doesn't? It seems that QB won't let me insert anything beyond the
WS> 32767 or -32768 limits using direct numbers as in my second clip...
WS> Is this a bug, an undocumented feature, or just another of those
WS> annoyances? :-)
Under most conditions, Basic assumes that literal, whole numbers are
integers -unless- a variable of greater precision appears to the left.
D& = A# * 533 * 8
-will- work. Basic evaluates expressions using the algebraic order of
operations. In the above example, it encountered A# and thus considered
any literal values (such as 533 and 8) as double precision as well.
This also works:
D& = 100& * 533& * 8&
D& = 100& * 533 * 8
Putting overrides on literals eliminates the guesswork in Basic's
automatic conversion of literals.
Believe it or not, this is documented .. just not in a great deal of
depth. Ethan Winer's book "PC Magazine's BASIC Techniques and
Utilities" describes this process (as well as many others). A highly
... Go straight to the docs. Do not pass GO. Do not collect $200!
--- Blue Wave/Max v2.10 [NR]
* Origin: Oakland BBS - McDonough, GA - (404) 954-0071 (1:133/706.0)