[Info-vax] : BASIC - PRINT USING a quad value
Art
awiens at postmedia.com
Fri Oct 14 10:33:41 EDT 2011
I am not a programmer.[/expectations]
A couple of years ago I wrote a simple Basic program to show disk freespace. I did it mostly to learn some basic Basic programming and how to work with descriptors but also it was handy little display utility.
I added a couple more 200GB LUNS to our test cluster and my program "broke" as it exceeded a LONG variable holding total blocks. The simple fix was to change a couple of variables to QUAD datatypes, and it now "works" again, but I can't get it to PRINT USING the new QUAD values.
As an example, I am trying to use this :
DECLARE STRING CONSTANT TOT_COMMAS = "#,###,###,###,###,###,###"
and this :
PRINT "TOT_MAXBLOCK is : ";TOT_MAXBLOCK
PRINT USING TOT_COMMAS, TOT_MAXBLOCK
But it gives me this :
TOT_MAXBLOCK is : 3070230528
0
Using this style of PRINT USING with LONG's works fine:
DECLARE STRING CONSTANT COMMAS = "#,###,###,###"
PRINT "DEV_MAXBLOCK is : ";DEV_MAXBLOCK
PRINT USING COMMAS, DEV_MAXBLOCK
DEV_MAXBLOCK is : 419430400
419,430,400
The Basic manual describes a LONG as 10 and a QUAD as 19 decimal digit precision. Why does it appear to be a 25 character field in the QUAD example? What am I not understanding?
Cheers,
Art
--
"Cheer up ... things could get worse"
So he did ... and they did!
More information about the Info-vax
mailing list