NORMALIZE( ) Function

Converts a character expression, supplied by a user, into a form that can be compared with Visual FoxPro function return values.

NORMALIZE(cExpression)

Return Values

Character

Parameters

  • cExpression
    Specifies the character expression to normalize.

Remarks

NORMALIZE( ) returns a character string from the character expression cExpression with the following changes:

  • The character expression is converted to uppercase. However, embedded strings are not changed. An example of an embedded string is "Hello" in the character expression "LEFT('Hello',1)".
  • Any abbreviated Visual FoxPro keywords in the character expression are expanded to their full length.
  • Any -> operators separating aliases from field names are converted to periods.
  • The syntax of any Visual FoxPro commands or functions within the character expression is checked, although the expression is not evaluated. If the syntax is incorrect, Visual FoxPro generates a syntax error. NORMALIZE( ) does not check for the existence of any fields, tables, memory variables, user-defined functions, or other references in the character expression.

For example, a user may enter an index expression like the following in the Expression Builder:

UPPE(cust->lname) + UPPE(cust->fname)

While this is a valid Visual FoxPro index key expression, it's difficult to compare this to the return values from a Visual FoxPro function like KEY( ). NORMALIZE( ) returns the following character string for the expression above:

UPPER(CUST.LNAME) + UPPER(CUST.FNAME)

This can be easily compared to the value returned by a function like KEY( ), making it possible for you, in this example, to determine if an index or index tag with the user-supplied index expression already exists.

See Also

EVALUATE( ) | ISUPPER( ) | PROPER( ) | UPPER( )