[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Can you right justify columns in SQR?



I hate it when I get it backward!!  Using nines will right justify. Sorry
for the confusion.

I also like your method of calculating the offset for character variables or
even using the LPAD function - all of those are good choices.  (trying to
save face:) Right-justified columns are relatively easy with fixed pitch
fonts - with proportional fonts, the work is much more difficult.

Nice catch, Don!

Rick

-----Original Message-----
From: don.barclay@srs.gov [mailto:don.barclay@srs.gov]
Sent: Tuesday, March 04, 2003 12:57 PM
To: sqr-users@sqrug.org
Subject: RE: [sqr-users] Can you right justify columns in SQR?


Rick,
Won't that left justify the numbers instead of right justifying the 
numbers? 

I would think the answer would depend on what the variable type is.  If 
the variable is text ($percent = '100%') you could do something like this:

let $text = '100%'
print ' ' (+1,10)
let #offset = 10 - length($text)
print $text (+1,+#offset)

let $text = '50%'
print ' ' (+1,10)
let #offset = 10 - length($text)
print $text (+1,+#offset)

let $text = '5%'
print ' ' (+1,10)
let #offset = 10 - length($text)
print $text (+1,+#offset)

Results:

  100%
   50%
    5%

Don Barclay
Westinghouse Savannah River Co.
Aiken, SC





"Lynds,Rick" <rlynds@mwdh2o.com>
Sent by: sqr-users-admin@sqrug.org


03/04/2003 01:36 PM
Please respond to sqr-users

 
        To:     "'sqr-users@sqrug.org'" <sqr-users@sqrug.org>
        cc: 
        Subject:        RE: [sqr-users] Can you right justify columns in
SQR?


Connie,

Assuming that you are using a fixed-pitch font for printing, then the
following could work:

                 print #a  (+1, 10) edit '888'
      print '%'       () 
HTH

Rick Lynds

-----Original Message-----
From: Hunter, Connie R Ms USAREC [mailto:Connie.Hunter@usarec.army.mil]
Sent: Tuesday, March 04, 2003 10:17 AM
To: 'sqr-users@sqrug.org'
Subject: [sqr-users] Can you right justify columns in SQR?


My data is not always the same length, i.e., 
100%
50%
5%

I would like to line everything up on the percent sign, not the first 
digit.
Using edit mask of xxx% doesn't get it...it returns
100%
50 %
5  %

Is there a way to left fill zeros? That might help move everything over a
notch or two.
Just trying to replicate the look of our old application :)

Thanks - last bit of help I received was FANTASTIC!!
 
Connie Hunter 
US Army Recruiting Command

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users