Futurebasic/language/string expressions

< Futurebasic < language

String Expressions

Revised for FBtoC 15 February 2008

Description

A string expression is anything that can be evaluated as a string of 0 to 255 characters. (Note that FutureBASIC also provides "Containers" with 2GB text capacity that operate very similarly to a standard string). A string can be expressed in any of the following ways:

Simple Expressions

Compound Expressions

A compound string expression is a list of simple string expressions separated by the concatenation operator "+". The syntax of a compound string expression is:

simpleExpr1 + simpleExpr2 [+ simpleExpr3 ...]

The "+" operator builds a longer string by concatenating the operands. For example:

"Ex" + "tra" + mid$( "fiction", 3 )

This expression has the value "Extraction".

Notes

If a string expression is assigned to a string variable too small to hold it, the expression is silently truncated to fit.

When two string expressions are separated by a data-comparison operator (==, !=, <, >) the result is a numeric expression. See Appendix D: Numeric Expressions.

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.