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> middle() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    MIDDLE()

Purpose:     Center a string by padding with leading and trailing spaces.

Syntax:      MIDDLE( string, width )

Arguments:   string      - Character string or variable which is to be
                           padded with leading and trailing spaces
                           sufficient to center in <width>.

             width       - Optional numeric value representing the desired
                           width of the returned string.  If omitted or an
                           invalid parameter is passed, the default width
                           is 80 characters.

Returns:     <string> padded with leading and trailing spaces to center
             <string> in a line of length <width>.

Description: MIDDLE() is a character/screen function used to pad strings
             with leading and trailing spaces sufficient to center the
             string in <width>.  It can most commonly be used in menuing
             and field edit schemes where a centered prompt message is
             needed at the bottom of the screen.  This can also be
             accomplished with the CENTER() function.  However, since
             middle returns strings with leading and trailing blanks, the
             line does not need to be erased first.

Notes:       The default width is 80 characters, ideal for screen oriented
             displays.  MIDDLE() works fine with wider widths for printed
             reports.

             The difference between MIDDLE() and CENTER() is that MIDDLE()
             can effectively erase any previous screen data.

Example:     *-- use MIDDLE() to display centered prompts
             @ 24,0 SAY MIDDLE("Press any key to continue")

Source:      RL_MIDDL.PRG

See also:    CENTER()

See Also: CENTER()

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