/* $DOC$
   $AUTHOR$
      Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
   $TEMPLATE$
      Function
   $NAME$
      Transform()
   $CATEGORY$
      API
   $SUBCATEGORY$
      Strings
   $ONELINER$
      Formats a value based on a specific picture template.
   $SYNTAX$
      Transform( <xExpression>, <cTemplate> ) --> cFormatted
   $ARGUMENTS$
      <xExpression> Any expression to be formatted.

      <cTemplate> Character string with picture template
   $RETURNS$
      <cFormatted> Formatted expression in character format
   $DESCRIPTION$
      This function returns <xExpression> in the format of the picture
      expression passed to the function as <cTemplate>.

      Their are two components that can make up <cTemplate> : a function
      string and a template string. Function strings are those functions
      that globally tell what the format of <xExpression> should be. These
      functions are represented by a single character precede by the
      @ symbol.

      There are a couple of rules to follow when using function strings
      and template strings:

       - First, a single space must fall between the function template
         and the template string if they are used in conjunction with
         one another.

       - Second, if both components make up the value of <cTemplate>, the
         function string must precede the template string. Otherwise, the
         function string may appear with out the template string and
         vice versa.

      The table below shows the possible function strings available with
      the Transform() function.

      <table-noheader>
       @B   Left justify the string within the format.
       @C   Issue a CR after format is numbers are positive.
       @D   Put dates in SET DATE format.
       @E   Put dates in BRITISH format.
       @L   Make a zero padded string out of the number.
       @R   Insert non template characters.
       @X   Issue a DB after format is numbers are negative.
       @Z   Display any zero as blank spaces.
       @(   Quotes around negative numbers
       @!   Convert alpha characters to uppercased format.
      </table>

      The second part of <cTemplate> consists of the format string. Each
      character in the string may be formatted based on using the follow
      characters as template markers for the string.

      <table-noheader>
       A,N,X,9,#   Any data type
       L           Shows logical as "T" or "F"
       Y           Shows logical as "Y" or "N"
       !           Convert to uppercase
       $           Dollar sing in place of leading spaces in numeric expression
       *           Asterisks in place of leading spaces in numeric expression
       ,           Commas position
       .           Decimal point position
      </table>
   $EXAMPLES$
      LOCAL cString := "This is harbour"
      LOCAL nNumber := 9923.34
      LOCAL nNumber1 := -95842.00
      LOCAL lValue := .T.
      LOCAL dDate := Date()
      ? "working with String"
      ? "Current String is", cString
      ? "All uppercased", Transform( cString, "@!" )
      ? "Date is", dDate
      ? "Date is", Transform( dDate, "@D" )
      ? Transform( nNumber, "@L 99999999" )  // --> "009923.34"
      ? Transform( 0      , "@L 9999"     )  // --> "0000"
   $STATUS$
      R
   $COMPLIANCE$
      The @L function template is a FoxPro/Xbase++ Extension
   $PLATFORMS$
      All
   $FILES$
      Library is core
   $SEEALSO$
      @...SAY, DevOutPict()
   $END$
 */
