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

Re: right justify - expounded



The following is a relevant message that Ray Ontko posted on this exact
question before (see the archives):

"Steve,

The short answer is "there's no easy way".  SQR doesn't "know"
anything about the widths of characters in proportional fonts,
so it doesn't support centering, wrapping, or right justifying
which requires knowledge of individual character widths.

For more background on the topic, search the archives for
"proportional font" at:

   http://www.sqrug.com/sqr-users/

If you MUST do it, there are a few routines that I and others
have written that do some of what you want (wrapping and truncation,
in particular).  You may be able to adapt them.  One is on the library
pages at www.sqrug.com, the other is at:

   http://www.ontko.com/sqr/hp.html

Ray"


On Tue, 1 Oct 2002, Geek Unlimited wrote:

> I guess I could have been clearer about what
> I've tried that didn't work, in addition to
> what I tried that almost worked.
>
> The following I could not get to work.
>
> Subtracting the string length from
> (#_sqr-max-columns - 1) and then left padding the
> string with that many spaces.
>
> Subtracting the string length from
> (#_sqr-max-columns - 1), printing that many spaces, and then printing the
> string right
> after it.
>
> Subtracting the string length from
> (#_sqr-max-columns - 1) and then creating an
> edit mask with the many "B"s, plus enough
> "X"s for the string itself.
>
> Using the R edit mask to reverse the string with
> right justification, then ltrim the string, then
> reverse it back.
>
> Andrew :)
>