On 11/12/02 12:14 PM, "DFast@..." <DFast@...> wrote: > 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. I wasn't sure so I checked the reference: > Effective with Release 3, a new syntax may be used with DIM. > DIM AS LONG a,b,c > DIM AS RECT myRect > The DIM AS syntax indicates that all variables that follow are of the same > type and size. > This is different from DIM a AS LONG which provides variable specification for > only one dimensioned variable in the statement. I prefer the DIM AS syntax now, it's closer to the C syntax, which saves my brain a little bit. I wish we could do as C does here: C: int myVar = 100; FB^3: word myVar = 100 instead of: word myVar: myVar = 100 Just seems redundant.