3.09 Instream Data

Overview

Instream data is a series of lines within a program that contain either LynPlex expressions or complete lines that may be in another language such as HTML.

A data stream starts with the word data and ends with a statement that consists solely of a delimiter. The delimiter can be any value and is specified on the data statement. Spaces surrounding the delimiter are ignored.

A data statement can be a separate command, in which case it must be immediately preceded by a label. The label will be used during processing to identify the data stream.

Alternatively, a data stream may also be started with the data keyword included in a put statement. In this case the data stream can only be processed as part of the put statement.

Expressions

Each statement in a data stream may be any expression or series of expressions that would be acceptable as the source of a put statement. This can include strings, numbers, variables, functions, commas and concatenation, including at the end of the line.

Raw Data

Each line may also be considered as a complete string. This can be used for generating code in another language that does not need interpreting.

If the word asis follows the word data, everything up to the delimiter line is considered to be raw data.

Future Options

To be implemented.

  • A data stream is read only and may not be changed. It may, however, be loaded into an array using the LOAD command. The data within the array can then be modified as required.
  • A data stream may also be used as the source for a GET statement.
  • Each line in a data stream can be accessed as if it were an element of an array.

DATA

Function:

Starts a data stream.

Syntax:

put [target,] data [asis] delim
:
delim

label:
data [asis] delim
:
delim
:
put [target,] data label

where:

delim
string used to mark the end of the in line data stream. This can be any set of characters other than a recognisable symbol or a comment.
label
start of an out of line data stream.

Examples:

put data \\\\\
"a line of data"
\\\\\

label:
data [##]
a line of data     
[##]
put data asis label
put data label

Implementation Status

LynPlex Interpreter
Fully implemented
LynPlexC Compiler
Not yet implemented.
LynPlexS Compiler
Not yet implemented.

lynplex/lp0309.txt · Last modified: 2012/09/08 15:01 (external edit)