Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> rjustify() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    RJUSTIFY()

Purpose:     Right justify string by moving trailing blanks to the front.

Syntax:      RJUSTIFY( string )

Arguments:   string      - Character string or variable to be right
                           justified.

Returns:     String with trailing blanks moved to the front of the string.

Description: Takes a character string and moves any trailing blanks to the
             front of the string, to allow for right justification in
             display or printing.

Notes:       Useful for displaying or printing character data that may
             have trailing blanks flush right in reports.

             The string returned is the same length as the one provided.

Example:     acct_num = SPACE(20)
             @ 1,0 SAY "Enter account number:" GET acct_num
             READ

             *-- they entered 12-34-567890 which has 8 trailing spaces
             *-- you want it printed flush right under the page number
             *-- on an 80 column display
             @ 1,67 SAY "Page No.: " + STR(pageno,3,0)
             @ 1,60 SAY RJUSTIFY(acct_num)
             *-- replaces: @ 1,60+20-LEN(TRIM(acct_num)) SAY ...

Source:      RL_RJUST.PRG

See also:    CENTER(), MIDDLE(), SAYINBOX()

See Also: CENTER() MIDDLE() SAYINBOX()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson