String Functions

Functions included in this section are listed below. Click a link to jump to that function.

General Information
$ Function

ALLTRIM( ) Function

ASC( ) Function

AT( ) Function

AT_C( ) Function

ATC( ) Function

ATCC( ) Function

CHR( ) Function

CHRTRAN( ) Function

CHRTRANC( ) Function

CTOBIN( ) Function

CURVAL( ) Function

GETPEM( ) Function

LEFT( ) Function

LEFTC ( ) Function

LEN( ) Function

LENC( ) Function

LOWER( ) Function

LTRIM( ) Function

MAX( ) Function

MIN( ) Function

OCCURS( ) Function

OEMTOANSI( ) Function

OLDVAL( ) Function

PEMSTATUS( ) Function

PADC( ) Functions

PADL( ) Functions

PADR( ) Functions

PROPER( ) Function

RAT( ) Function

RATC( ) Function

REPLICATE( ) Function

RIGHT( ) Function

RIGHTC( ) Function

RTRIM( ) Function

SOUNDEX( ) Function

SPACE( ) Function

STR( ) Function

STRCONV( ) Function

STRTRAN( ) Function

STUFF( ) Function

STUFFC( ) Function

SUBSTR( ) Function

SUBSTRC( ) Function

TRANSFORM( ) Function

TRIM( ) Function

TYPE( ) Function

UPPER( ) Function

General Information

"text" Enclose text in quotes.
+ Performs character string concatenation. String 2 is added to string 1.

A = "Hello, "

B = "Joe"

A + B = "Hello, Joe"

- Removes trailing spaces from String 1 and adds them to end of string 2

A - B = "Hello,Joe "

$ Function

Purpose Returns true (.T.) if a character expression is contained in another character expression; otherwise returns false (.F.).

If the character expression isn't found, false (.F.) is returned

Syntax <expC1> $ <expC2>
Returns Logical: .T. or .F.
Parameter <expC1> Search string

<expC2> String to be searched

Remarks If <expC1> is found in <expC2>, .T. is returned. If <expC1> isn't found in <expC2>, .F. is returned. This function is case sensitive (upper- and lower-case are respected).
Examples
Trans$’NEW,REN,REW’ Returns: true (.T.) if the transaction type is NEW or REN or REW
Key$’BCFL’ Returns: true (.T.) if the record a for a broker, customer, finance co. or a lien holder
‘Mr.’$Name Returns: true (.T.) if Mr. is in the name field

ALLTRIM( ) Function

Purpose Removes leading and trailing blanks from the specified character expression and returns the trimmed expression as a character string. This function can be used to ensure that blanks are removed from data entered by a user.
Syntax ALLTRIM(<expC>)
Returns Returns the specified character expression with leading and trailing blanks removed.
Parameter <expC> Leading and trailing blanks are removed from the character expression <expC>.
Examples
ALLTRIM(city)+ ‘, ‘ +st+ ‘ ‘ +zipcode Returns: Lansing, IL 60438
Without ALLTRIM() Returns: Lansing , IL 60438

ASC( ) Function

Purpose Returns the ASCII code equivalent of the first character in a character expression.
Syntax ASC(<expC>)
Returns Numeric
Parameter <expC) The ASCII code equivalent is returned for the first character in the character expression <expC>. Any characters after the first character are ignored.
Examples
ASC(‘A’) Returns: 65

AT( ) Function

Purpose Returns the beginning numeric position of the first occurrence of a character expression or memo field within another character expression or memo field, counting from the leftmost character
Syntax AT(<expC1>, <expC2>[, <expN>])
Returns Numeric
Parameter <expC1>, <expC2> FoxPro looks for the search character expression <expC1> in the second character expression <expC2>. The character expressions <expC1> and <expC2> can be of any size. If <expN> is included, AT( ) searches for the <expN>the occurrence of <expC1> in <expC2>. By default, AT( ) searches for the first occurrence of <expC1> (<expN> = 1). Including <expN> lets you search for additional occurrences of <expC1> in <expC2>.
Remarks AT( ) searches the second character expression for the first occurrence of the first character expression. It then returns an integer indicating the position of the first character in the found character expression. If the character expression isn't found, 0 is returned. The search performed by AT( ) is case sensitive (upper and lower-case is respected). To perform a search that isn't case sensitive, use ATC( ).
Examples
AT(‘rate’,note) If note is ‘Home rated 8/4/90’, it returns 6.

AT_C( ) Function

This function is not used in TAM.

ATC( ) Function

Purpose Returns the beginning numeric position of the first occurrence of a character expression or memo field within another character expression or memo field, without regard for the case of these two expressions.
Syntax ATC(<expC1>, <expC2>[, <expN>])
Returns Numeric
Parameter <expC1>, <expC2> ATC( ) searches <expC2> for <expC1>. The character expressions <expC1> and <expC2> can be fields of any size.

<expN>

If <expN> is included, ATC( ) searches for the <expN>The occurrence of <expC1> in <expC2>. By default, ATC( ) searches for the first occurrence of <expC1> (<expN> = 1). Including <expN> lets you search for additional occurrences of <expC1> in <expC2>.

Remarks ATC( ) searches the second character expression for the occurrence of the first character expression, without concern for the case (upper or lower) of the characters in either expression. Use AT( ) to perform a case-sensitive search.

ATC( ) returns an integer corresponding to the position where the first character of the character expression is found.

If the character expression isn't found, 0 is returned.

Examples
ATC(‘RATE’, note) If note is ‘We rated AUTO 12/2/95’, it returns 4.

ATCC( ) Function

This function is not used in TAM.

CHR( ) Function

Purpose Returns the character associated with the specified numeric ASCII code
Syntax CHR(<expN>)
Returns Character
Parameter Include in CHR( ) a numeric expression <expN> that evaluates to a number in the range of 0 to 255. The numeric expression is evaluated and the equivalent ASCII character is returned. Use ASC( ) to return the ASCII code for a specified character. CHR( ) returns a single character corresponding to a numeric expression. CHR( ) can be used to send printer control codes to a printer.
Examples
CHR(65) Returns: A

CHRTRAN( ) Function

Purpose Replaces each character in a character expression that matches a character in a second character expression with the corresponding character in a third character expression.
Syntax CHRTRAN(<expC1>, <expC2>, <expC3>)
Returns Character
Parameter <expC1>, <expC2>, <expC3>

If a character from <expC1> is found in <expC2>, the character in <expC1> is replaced by the character from <expC3> that's in the same position in <expC3> as is the character in <expC2>.

If <expC3> has fewer characters than <expC2>, the additional characters in <expC2> are translated to null characters. If <expC3> has more characters than <expC2>, the additional characters are ignored.

Examples
CHRTRAN(‘abcdef’,’ace’,’xyz’) Returns: xbydzf
CHRTRAN(‘abcd’,’abc’,’yz’) Returns: yzd
CHRTRAN(‘abcdef’,’ace’,’qrstxyz’) Returns: qbrdsf

CHRTRANC( ) Function

This function is not used in TAM.

CTOBIN( ) Function

Purpose Converts a binary character representation to an integer value
Syntax CTOBIN(<expC>)
Returns Numeric
Parameter <expC> <expC> specifies the binary character representation to convert
Remarks Use CTOBIN( ) to convert a binary character representation created with BINTOC( ) back to its integer value.

CURVAL( ) Function

This function is not used in TAM.

GETPEM( ) Function

This function is not used in TAM.

LEFT( ) Function

Purpose Returns a specified number of characters from a character expression, starting with the leftmost character.
Syntax LEFT(<expC>, <expN>)
Returns Character
Parameter <expC> Characters are returned from the character expression specified with <expC>.

<expN> The number of characters returned from the character expression is specified with <expN>. If <expN> is greater than the length of <expC>, all of the character expression is returned. The null string is returned if <expN> is negative or 0.

Examples
LEFT(pol_idx,7) Returns the first seven characters of pol_idx.
   If pol_idx is ‘ABBOJO1-3001’, it returns ‘ABBOJO1’.

LEFTC( ) Function

This function is not used in TAM.

LEN( ) Function

Purpose Returns the number of characters in a character expression.
Syntax LEN(<expC>)
Returns Numeric
Parameter <expC> <expC> is the character expression whose length you want to determine
Examples LEN(pol_idx)     If pol_idx is ‘ABBOJO1-3001’, it returns 12.

 

LENC( ) Function

This function is not used in TAM.

LOWER( ) Function

Purpose Returns a specified character expression in lower-case letters.
Syntax LOWER(<expC>)
Returns Character
Parameter <expC> is the character expression you want to convert to lower-case.
Examples
LOWER(‘ABCDEF’) Returns:abcdef
LOWER(name) If name is ‘ABC Company’, it returns ‘abc company’.

LTRIM( ) Function

Purpose Returns the specified character expression with leading blanks removed.

LTRIM( ) returns a character string that results from removing the leading blanks from a character expression. This function is especially useful for removing the leading blanks that are inserted when you use STR( ) to convert a numeric value to a character string.

Syntax LTRIM(<expC>)
Returns Character
Parameter <expC> Include the character expression <expC> from which you want to trim the leading blanks.
Examples
LTRIM(phone) If phone is ‘ 555-3333’, it returns ‘555-3333’.

MAX( ) Function

Purpose Returns the expression with the highest ASCII or numeric value or the latest date from a list of character, numeric or date expressions.
Syntax MAX(<expr1>, <expr2>[, <expr3> ... ])
Returns Character, Date or Numeric
Parameter <expr1>, <expr2>[, <expr3> ... ] <expr1>, <expr2>, and <expr3> are the set of expressions from which you want MAX( ) to return the expression with the highest value.

All the expressions must be of the same type (character, numeric or date).

Examples
MAX(‘A’,’B’,’C’,’a’) Returns:a.
MAX({08/01/99},DATE()) Compares the current date to 8/1/99 and returns the latest.
MAX(date,duedate,effdate) Returns the most newest date.
MAX(prem) Returns the highest premium amount when used in summary output or in the footer band on a report format.

MIN( ) Function

Purpose Returns the expression with the lowest ASCII or numeric value or the earliest date in a list of character, numeric or date expressions.
Syntax MIN(<expr1>, <expr2>[, <expr3> ...])
Returns Character, Date or Numeric
Parameter <expr1>, <expr2>[, <expr3> ...] <expr1>, <expr2>, and <expr3> are the set of expressions from which you want MIN( ) to return the expression with the lowest value. All the expressions must be of the same type (character, numeric or date).
Remarks MIN( ) (minimum) evaluates a set of numeric expressions and returns the expression with the smallest value. When determining the minimum date value from a set of dates, MIN( ) returns the earliest date.

MIN( ) returns the character expression with the minimum ASCII value from a set of character expressions.

Examples
MIN(‘A’,’B’,’C’,’a’) Returns:A
MIN({08/01/1850},DATE()) Compares the current date to 8/1/99 and returns the oldest 8/1/1850
MIN(date,duedate,effdate) Returns the oldest date
MIN(prem) Returns the lowest premium amount when used in summary output or in the footer band on a report format.

OCCURS( ) Function

Purpose Returns the number of times the value of a character expression occurs within another character expression.
Syntax OCCURS(<expC1>, <expC2>)
Returns Numeric
Parameter <expC1> Include a character expression <expC1> for which to search.

<expC2> The second character expression <expC2> is searched for occurrences of the first character expression <expC1>. OCCURS( ) returns zero if the value of an expression isn't found in the value of another expression.

Examples
OCCURS(‘X’,note) Returns the number of Xs in the note field.

OEMTOANSI( ) Function

This function is not used in TAM.

OLDVAL( ) Function

This function is not used in TAM.

PEMSTATUS( ) Function

This function is not used in TAM.

PADC( ) | PADL( ) | PADR( ) Functions

Purpose Returns the specified expression padded on the left, right, or both left and right sides.
Syntax PADL(<expr>, <expN>[, <expC>]) 

PADR(<expr>, <expN>[, <expC>])

PADC(<expr>, <expN>[, <expC>])

These functions return a character string from a character expression, padded to a specified length. PADL( ) inserts padding on the left, PADR( ) inserts padding on the right and PADC( ) inserts padding on both sides.

Returns Character
Parameter <expr> Include the expression <expr> to be padded. This expression can be a character, numeric or date expression.

<expN> specifies the total number of characters in the expression after it is padded.

<expC> The value of <expC> is used for padding. If <expC> is omitted, spaces (ASC(32)) are used for padding. If <expC> is included, the value of <expC> is repeated as necessary to pad the expression <expr> to a length of <expN> characters.

Examples
PADL(‘TITLE’,15,’=’) Returns: ==========TITLE
PADR(‘TITLE’,15,’*’) Returns: TITLE**********
PADC(‘TITLE’,15,’-‘) Returns: ------TITLE------
PADR(name,40) Returns the name with trailing spaces to fill 40 characters

PROPER( ) Function

Purpose Returns the specified character expression with each word having the initial letter capitalized and the remaining characters lowercase. PROPER( ) returns from a character expression a character string capitalized as appropriate for proper names.
Syntax PROPER(<expC>)
Returns Character
Parameter <expC> A properly capitalized character string is returned from the character expression <expC> you specify.
Examples
PROPER(Name)  If note is MARK K. SMITH, it returns Mark K. Smith.

RAT( ) Function

Purpose Returns the beginning numeric position of the first occurrence of one character expression or memo field within another character expression or memo field, counting from the rightmost character.
Syntax RAT(<expC1>, <expC2>[, <expN>])
Returns Numeric
Parameter <expC1>, <expC2> RAT( ) looks for <expC1> in <expC2>. <expC1> and <expC2> can be memo fields.

<expN> Include <expN> to specify which occurrence of <expC1> in <expC2> to look for.

By default, RAT( ) searches for the first occurrence of <expC1> (<expN> = 1). If <expN> is included, RAT( ) searches for the <expN>th occurrence of <expC1> in <expC2>. 0 is returned if <expN> is higher than the number of times <expC1> occurs in <expC2>.

Remarks RAT( ), the reverse AT( ) function, searches a character expression, starting with the last character in the expression, for the occurrence of another character expression. It then returns an integer corresponding to the position where the first character in the character expression is found. 0 is returned if the character expression isn't found.

The search performed by RAT( ) is case sensitive; upper-case and lower-case are respected.

Examples
RAT(‘ins’,desc) If desc is Work Comp installment, it returns 11.

RATC( ) Function

This function is not used in TAM.

REPLICATE( ) Function

Purpose Returns a character string that contains a specified character expression repeated a specified number of times.
Syntax REPLICATE(<expC>, <expN>)
Returns Character
Parameter <expC> The character expression that is replicated is specified in <expC>.

<expN> The character expression is replicated <expN> times.

Remarks The maximum length of the resulting character string cannot exceed 64,000 characters in the Standard version of FoxPro for MS-DOS. In the 32-bit Extended version of FoxPro for MS-DOS and in FoxPro for Windows, the maximum length of the resulting character string is restricted by the amount of available memory.
Examples REPLICATE(‘*^’,4)         Returns: *^*^*^*^

RIGHT( ) Function

Purpose Returns the specified number of rightmost characters from a character string.
Syntax RIGHT(<expC>, <expN>)
Returns Character
Parameter <expC> Rightmost characters are returned from the character expression specified in <expC>.

<expN> The number of characters returned from the character expression is specified by <expN>. All of the character expression is returned if <expN> is greater than the length of <expC>. The null string is returned if <expN> is negative or 0. Characters are returned beginning with the last character on the right and continuing for a specified number of characters.

Examples
RIGHT(month,2) If month is ‘9908’, it returns ‘08’.
RIGHT(phr,8) If phr is ‘800-555-3333’, it returns ‘555-3333’.

RIGHTC( ) Function

This function is not used in TAM.

RTRIM( ) Function

Purpose Returns the specified character expression with all trailing blanks removed.
Syntax RTRIM(<expC>)
Returns Character
Parameter <expC> Include the character expression <expC> to trim the trailing blanks from.

RTRIM( ) returns a character string that results from removing the trailing blanks from a character expression.

RTRIM( ) is identical to TRIM( ).

Examples RTRIM(city) If city is 'Chicago ', it returns 'Chicago'.

SOUNDEX( ) Function

Purpose Returns a phonetic representation of the specified character expression.
Syntax SOUNDEX(<expC>)
Returns Character
Parameter <expC> Specify the character expression SOUNDEX( ) evaluates with <expC>.
Remarks SOUNDEX( ) returns a four-character string. By comparing the results SOUNDEX( ) returns for two character expressions, you can determine if the two expressions are phonetically similar, indicating that they sound alike. This can be useful when searching for duplicate records in a table/.DBF.

SOUNDEX( ) isn't case sensitive and generally disregards vowels.

Examples
SOUNDEX(‘Computer’) Returns: C513
SOUNDEX(‘Smith’)=SOUNDEX(‘SMYTH’) Returns: .T

SPACE( ) Function

Purpose Returns a character string composed of a specified number of spaces.
Syntax SPACE(<expN>)
Returns Character
Parameter <expN> Specify the number of spaces returned by SPACE( ) with <expN>.
Examples SPACE(10)     Returns: 10 spaces

STR( ) Function

Purpose Returns the character string equivalent to a specified numeric expression.
Syntax Syntax: STR(<expN1>[, <expN2>[, <expN3>]])
Returns Character
Parameter <expN1> The numeric expression evaluated by STR( ) is specified by <expN1>.

<expN2> The length of the character string returned by STR( ) is specified with <expN2>. The length includes one character for the decimal point and one character for each digit to the right of the decimal point. STR( ) pads the character string with leading spaces if you specify a length larger than the number of digits left of the decimal point. STR( ) returns a string of asterisks, indicating numeric overflow, if you specify a length less than the number of digits left of the decimal point.

<expN3> The number of decimal places in the character string returned by STR( ) is specified by the numeric expression <expN3>.

You must include <expN2> to specify the number of decimal places. If you specify fewer decimal places than are in the numeric expression <expN1>, the extra digits are truncated.

Examples
STR(1235642.9,12,3) Returns: 1235642.900
STR(amt,12,2) If amt is 900, it returns 900.00.

STRCONV( ) Function

This function is not used in TAM.

STRTRAN( ) Function

Purpose Searches a character expression or memo field for occurrences of a second character expression or memo field, and then replaces each occurrence with a third character expression or memo field.

You can specify where the replacement begins and how many replacements are made. STRTRAN( ) returns the resulting character string.

Syntax STRTRAN(<expC1>, <expC2>[, <expC3>] [, <expN1>] [, <expN2>])
Returns Character
Parameter <expC1> The character expression that's searched is specified with <expC1>. <expC1> can be a memo field.

<expC2> The character expression that's searched for in <expC1> is specified with <expC2>.

The search is case-sensitive (lower-case and upper-case are respected). <expC2> can be a memo field.

<expC3> The search character expression <expC2> is replaced in <expC1> by the character expression <expC3>. If <expC3> is omitted, <expC2> is replaced with the null string.

<expN1> The optional numeric expression <expN1> specifies which occurrence of <expC2> is the first to be replaced.

For example, if <expN1> is 4, replacement begins with the fourth occurrence of <expC2> in <expC1>, counting from the left, and the first three occurrences of <expC2> remain unchanged. The occurrence where replacement begins defaults to 1 if <expN1> is omitted.

<expN2> specifies the number of occurrences of <expC2> to replace. If <expN2> is omitted, all occurrences of <expC2>, starting with the occurrence specified in <expN1>, are replaced.

Examples
STRTRAN(‘abracadabra’,’a’,’z’) Returns: zbrzcdzbrz
STRTRAN(desc,’house’,’home’) If desc is ‘This house is on a corner’, it returns ‘This home is on a corner’.

STUFF( ) Function

Purpose Returns a character string created by replacing a specified number of characters in a character expression with another character expression.
Syntax STUFF(<expC1>, <expN1>, <expN2>, <expC2>)
Returns Character
Parameter <expC1> Specify the character expression <expC1> in which the replacement occurs.

<expN1> specifies the position in <expC1> where the replacement begins.

<expN2> The number of characters to be replaced is specified by <expN2>. If <expN2> is 0, the replacement string <expC2> is inserted into <expC1>. <expC2> The replacement character expression is specified by <expC2>. If <expC2> is the null string, the number of characters specified by <expN2> are removed from <expC1>.

Examples
STUFF(‘abcdefgh’,4,0,’123’) Inserts Returns: abc123defgh
STUFF(‘abcdefgh’,4,3,’123’) Replaces Returns: abc123gh
STUFF(‘abcdefgh’,4,4,’’) Deletes Returns: abch
STUFF(‘abcdefgh’,4,1,’123’) Replaces and Inserts Returns: abc123efgh
STUFF(‘abcdefgh’,4,4,’123’) Replaces and Deletes Returns: abc123h
STUFF(desc,5,10,’xx’) If desc is ‘Work Comp Installment’, it returns ‘Workxxallment’.

STUFFC( ) Function

This function is not used in TAM.

SUBSTR( ) Function

Purpose Returns a specified number of characters from the given character expression or memo field.

This function extracts and returns characters from a character expression, starting at a specified position in the character expression and continuing for a specified number of characters.

Syntax SUBSTR(<expC>, <expN1>[, <expN2>])
Returns Character
Parameter <expC> The character expression from which characters are extracted is specified by <expC>. The expression <expC> can be a memo field.

<expN1> The position in the character expression <expC> where character extraction begins is specified by <expN1>. The first character of <expC> is position 1.

<expN2> Specifies the number of characters to extract from <expC>. If <expN2> is omitted, characters are extracted until the end of the character expression is reached.

Examples
SUBSTR(‘abcdefgh’,3,2) Returns: cd
SUBSTR(‘abcdefgh’,5) Returns: efgh
SUBSTR(ins.c,5,15) Returns: the customer’s occupation from the c field.

SUBSTRC( ) Function

This function is not used in TAM.

TRANSFORM( ) Function

Purpose Formats character or numeric expressions using PICTURE and FUNCTION codes available for @ ... SAY.

TRANSFORM( ) returns a character string in a format determined by a character expression containing the format codes.

Syntax TRANSFORM(<expr>, <expC>)
Returns Character
Parameter <expr> Specify the numeric or character expression to format with <expr>.

<expC> is one or more format codes that specify how the expression is formatted.

Format Codes Description
@C CR is appended to positive currency or numeric values to indicate a credit.
@D Date and DateTime values are converted to the current SET DATE format.
@E Date and DateTime values are converted to a BRITISH date format.
@R The transformation uses a format mask. The mask characters are not stored to the transformed value. Use only with character or numeric data. Mask characters include:

9 or #Represents a character or number.

!Converts lower-case letters to upper-case letters.

@T Leading and trailing spaces are trimmed from character values.
@X DB is appended to negative currency or numeric values to indicate a debit.
@Z If 0, currency or numeric values are converted to spaces.
@( Encloses negative currency or numeric values in parentheses.
@^ Converts currency or numeric values to scientific notation.
@0 Converts numeric or currency values to their hexadecimal equivalents. The numeric or currency value must be positive and less than 4,294,967,296.
@! Converts an entire character string to uppercase.
@$ Adds the current currency symbol specified by SET CURRENCY to currency and numeric values. By default, the symbol is placed immediately before or after the value. However, the currency symbol and its placement (specified with SET CURRENCY), the separator character (specified with SET SEPARATOR) and the decimal character (specified with SET POINT) can all be changed.
X Specifies the width of character values. For example, if <expC> format codes is 'XX', 2 characters are returned.
Y Converts logical true (.T.) and false (.F.) values to Y and N, respectively.
! Converts a lowercase character to uppercase in the corresponding position in a character string.
. Specifies the decimal point position in currency and numeric values.
, Separates digits to the left of the decimal point in currency and numeric values.

If you omit <expC> format codes, Visual FoxPro performs a default transformation on <expr>. The following table describes the transformation performed for each data type <expr> can assume:

Data Type Transformation Description
Character No transformation is performed.
Currency Transformation is determined by the settings specified in the Regional tab of the Options dialog box.
Date A DTOC( ) transformation is performed on the date.
DateTime A TTOC( ) transformation is performed on the date time.
Logical Logical true (.T.) and false (.F.) values are transformed to the character strings ".T." and ".F." respectively.
Numeric (includes Double, Float, or Integer data types) Trailing zeros are removed from the decimal portion of a numeric value. If the numeric value is a whole number, a decimal point is not included in the transformed value (for example, 4.0 is transformed to 4). If the numeric value is less than one but greater than negative one, zero is included before the decimal point (for example, .4 is transformed to 0.4).
Memo No transformation is performed.
Examples TRANSFORM(amt,’$$$$$$$$$.99’)       If amt is 5566776.00, it returns $5566776.00.

TRIM( ) Function

Purpose Returns the specified character expression with all trailing blanks removed.
Syntax TRIM(<expC>)
Returns Character
Parameter <expC> Specifies the character expression from which TRIM( ) removes all trailing blanks.
Remarks TRIM( ) is identical to RTRIM( ).
Examples TRIM(city) If city is ‘Chicago ‘, it returns ‘Chicago’.

TYPE( ) Function

Purpose Returns the data type of the specified memo field or character, numeric, logical or date expression.
Syntax TYPE(<expC>)
Returns Character
Parameter <expC> Is the name of a memo field or a character expression. TYPE( ) evaluates the contents of <expC> and returns the appropriate data type.
Remarks The following table lists the characters TYPE( ) returns and their corresponding data types:
Data Type Character Returned
Character C
Numeric (also float) N
Date D
Logical L
Memo M
Undefined type of expression U
Examples TYPE(date)  Returns: D

UPPER( ) Function

Purpose Returns the specified character expression in upper-case.

Each lower-case letter (az) in the character expression is converted to upper-case (AZ) in the returned string.

All other characters remain unchanged.

Syntax UPPER(<expC>)
Returns Character
Parameter <expC> Is the character expression you want to convert to upper-case.
Examples UPPER(name) If name is ‘Mark K Smith’, it returns ‘MARK K SMITH’.