String Variables & Assignment

Strings are sequences of characters.  A string variable holds a sequence of characters.  One last detail:  Raptor doesn't support arrays of strings.

 

Many programs use strings, usually to output messages to the user.  For example, you might see a string in an Output Symbol:

 

or as an argument (in the example below, "Score") in a Call:

 

 

However, sometimes the programmer wants to compute or build a string to output, and that's when string variables are used.

 

A string variable is given a value in an assignment symbol or in an input symbol.  The section below discusses assigning strings values.

 

Assigning values to strings

 

In an assignment symbol, Raptor can determine that the variable is a string, because the value being assigned is a string expression.  A string expression is either

  

Below are several examples (unrelated to each other) of string variables being assigned values.