[futurebasic] RE: [FB] Question on Integer(%) and Long Integer(!): Now a bit of trivia.

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2002 : Group Archive : Group : All Groups

From: DFast@...
Date: Tue, 12 Nov 2002 12:14:23 -0800
OK, so I changed my next program to DIM all variables. I am also utilizing
PRINT USING to line things up and to format the correct number of decimal
places. I am getting a "rounding" effect that appears to wipe out the
decimal value; ie, behaving as INTEGER instead of DOUBLE. Again, my thinking
was incorrect. Evidently the AS DOUBLE only applies to the single,
immediately preceding variable. 

=======================
BEGIN GLOBALS
 DIM Inches,Feet,Yards,Miles AS DOUBLE
 DIM Centimeters,Decimeters,Meters,Kilometers AS DOUBLE
 DIM PROGRAM$
END GLOBALS
=======================

It appears that this is NOT equivalent to:

=======================
BEGIN GLOBALS
 DIM AS DOUBLE Inches,Feet,Yards,Miles 
 DIM AS DOUBLE Centimeters,Decimeters,Meters,Kilometers
 DIM PROGRAM$
END GLOBALS
=======================

This works correctly.



-----Original Message-----
From: Heather Donahue [mailto:maclists@...]
Sent: Friday, November 08, 2002 2:24 PM
To: futurebasic@...
Subject: Re: [FB] Question on Integer(%) and Long Integer(!)
>>> snip  <<<
Plus you should really DIM all your variables, and another reason why DIM AS
LONG is superior to DIM Intnum2&