IB Statements/ucase

From CometWiki

Jump to: navigation, search

UCASE function

Syntax: UCASE(string-argument)

Discussion: The UCASE function converts lower case characters in a string-argument to upper case characters. Other characters in the string-argument (e.g., upper case characters, special characters) remain unchanged.

The string-argument may be a string constant, a single-element string variable, a string array element, a string expression, or a string function.

See LCASE.

Example 1: Y$ = UCASE(X$)

In the above example, any lower case characters contained in X$ are converted to upper case and the entire string is moved to Y$. For example, if X$ equals "Signature Systems" then Y$ will equal "SIGNATURE SYSTEMS".


Example 2:

INPUT (0) ANSWER$
IF UCASE(ANSWER$) = "Y" THEN GOTO 9000

In this example, the variable ANSWER$ is used to receive input data from the terminal (logical unit 0). The data is then converted to upper case and compared to "Y". If it equals "Y" the program branches to statement 9000. Otherwise, program flow continues below the IF statement.

Personal tools