Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>maxline()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MAXLINE()

Syntax:     MAXLINE(<expC>)

Arguments:  <expC> is the string to be processed.

Returns:    A numeric value.
            The function will return the maximum length of line necessary
            to display <expC> text without having line breaks.

Usage:      MAXLINE() will seek the longest line within a string.  Thus it
            enables the required width of a window for displaying a
            memo field to be determined, making it possible to display
            the text without adding line breaks.

Notes:      This function will teat all characters apart from the carriage
            return or line feed characters as printable characters of width
            1.  So if the <expC> text contains tab characters, then use
            the function TABEXPAND() to expand them.

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   * A function which performs a suitable call-up
            * for MEMOEDIT() automatically according to
            * the maximum length of line.

            FUNCTION ShowMemo
            PARAMETERS memo
            PRIVATE message,height,width

            height = MIN(NUMLINE(memo),MAXROW()-1)
            width = MIN(MAXLINE(memo),MAXCOL()-1)

            IF width = 0
               message = "The memo field is empty."
            ELSE
               message = ""
               @ 0,0 TO height+1,width+1 DOUBLE
               MEMOEDIT(memo,1,1,height,width,.F.)
            ENDIF

            RETURN (message)



See Also: NUMLINE() TABEXPAND()

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