Understanding Character Expressions

PracticeScript can evaluate the following data types: numeric expressions and alphabetic characters. A series of alphabetic characters in PracticeScript is referred to as a character string. The simplest type of character string is the constant string, such as “John”.

In this example, the constant string literally represents the string of letters J, o, h, and n.

There are a limited number of things you can do with character strings. While you can add, subtract, divide, or multiply numerical expressions, you can only add character strings. The expression "John" + "Smith" evaluates to "JohnSmith".

The expression "John" + " " + "Smith" evaluates to "John Smith".

The second expression adds three constant strings together:

"John", a space, and "Smith". This technique is used for creating expressions that are meant to be read and that require appropriate formatting, such as a person's name.

 

Related Topics

Using PracticeScript

Understanding the Language

Understanding the Rules of Precedence