[Info-vax] BASIC - PRINT USING a quad value

John Reagan johnrreagan at earthlink.net
Fri Oct 14 12:01:34 EDT 2011


"Art" <awiens at postmedia.com> wrote in message 
news:j79h85$h0n$1 at posting2.glorb.com...
>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?

I believe this is a known bug and was fixed earlier this year (after V8.4 
was released).  It only seems to be PRINT USING.  Try using FORMAT$

DECLARE QUAD testval%
testval% = 32000
PRINT "PRINT TESTVAL [" + NUM1$(testval%) + "]"
PRINT USING "PRINT USING TESTVAL: <0>###################", testval%
PRINT FORMAT$(testval%,"FORMAT$: <0>###############")

I have no idea if an ECO to the BASIC RTL is available, planned, etc. 
Contact support and ask about QXCM1001086149

John 





More information about the Info-vax mailing list