Xbasic

<<%DELIMITER% ... %DELIMITER%

Syntax

List as C = <<%DELIMITER% string1 string2 ... stringN %DELIMITER%

Arguments

string1, stringNCharacter

Any character string.

Description

<<%DELIMITER% ... %DELIMITER% allows you to define a quoted character string. This command is typically used when the string includes carriage return-line feed characters (CR-LF).

<<%DELIMITER% must be terminated with a newline. Any spaces or other characters after the closing % will result in an "Extra characters at end of expression" error.

The string used for "DELIMITER" can be any text you like, as long as it is identical in the opening and closing delimiter statements.

For example:

X = <<%a%
Alpha Software
%a%
Y = <<%b%
Alpha Anywhere
%b%

The above two commands are equivalent to:

X = "Alpha Software"
Y = "Alpha Anywhere"

The Xbasic autohelp system will offer suggestions for delimiters as you write your scripts. There are several special case delimiters, such as %code% and %html%, which add special behaviors such as syntax highlighting and validation. The delimiters offered through autohelp include:

Delimiter
Description
<<%a5w% ... %a5w%

A5W page string

<<%code% ... %code%

Xbasic code string. Xbasic written inside code blocks will have full access to autohelp and includes syntax highlighting.

<<%css% ... %css%

CSS code string. CSS written inside a CSS block will include syntax highlighting and autohelp.

<<%dlg% ... %dlg%

XDialog string. XDialog code written inside dlg blocks will have syntax highlighting and autohelp.

<<%html% ... %html%

HTML code string. HTML written inside html blocks will have syntax highlighting and autohelp.

<<%js% ... %js%

JavaScript code string.

<<%json% ... %json%

JSON string.

<<%xml% ... %xml%

XML string. XML code written inside xml blocks will have syntax highlighting and autohelp.

<<%str% ... %str%

Text string.

<<%txt% ... %txt%

Text string.

Example: Array Initialization 

The following script initializes an array.

dim colors10 as C
' First, create a string with a list of choices. Each choice is delimited with CR-LF
color_string = <<%choices%
Red
Green
Blue
Orange
Purple
%choices%

' Then, initialize the array with the CR-LF delimited string.
colors.initialize(color_string)

See Also