Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>sx_slimfast():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_SlimFast():

  Syntax:  Sx_SlimFast(cExpression)

           cExpression = Any character string or expression

  Returns:   <char> Slimmed-down expression or string

  Description:    This is a utility function that takes a character string
                  as a parameter.  The string is converted to upper-case
                  (except for anything in quotes), and all extraneous blanks
                  are removed.

                  NOTE: This does not remove ALL spaces from the string.
                        However, it converts all multiple spaces into a
                        single space.

                  One good usage for this function would be to take a user-
                  supplied expression (such as a query or filter expression)
                  and clean it up for storing or use in a function.

                  For example:

                    Sx_SlimFast("for   tmp->name    <=  'John Smith'")

                  would return:

                    FOR TMP->NAME <= 'John Smith'

  Example:

    /*
        This program accepts an expression in quotes from the command
        line and displays the clean version.

        Compile: CLIPPER <prg> /n
    */

    #include "SIXCDX.CH"

    FUNC Main(cExpression)

      IF (cExpression == NIL)
        ? "USAGE: SLIMFAST <expression>"
        ? "      where <expression> is any FOR-type expression, such as:"
        ? '        "FOR lastname == ' + "'" + 'Smith"'
        ?
        QUIT
      ENDIF
      ? "Here it is:", Sx_SlimFast( cExpression )

    Return(NIL)


See Also: Sx_FNameParser()

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