In B4P, plain text is any kind of text which is specified without quotation marks. Such text contents are limited to one line and all characters are allowed except B4P specific symbols such as operators and various forms of parentheses / brackets.
Plain text may contains spaces, however multiple consecutive spaces and tabs are interpreted as single spaces.
Hello World is the same as Hello World. Leading and trailing spaces are ignored.
Plain text can be used for
Following rules apply for plain text:
Good Examples | Interpretation | Bad Examples | Interpretation |
---|---|---|---|
Hello World | Text | Baden-Baden | Minus sign: Text subtraction. Returns blank. |
555 1212 | Text and not number | 1.2 | This is a number |
1.234.567 | Text (multiple points) | 1,234.567 | Comma is a B4P specifc symbol |
_1 | Text | -1 | This is a number |
10 Main St. | Text | 10..12 Main St. | '..' describes ranges |
25.12.2024 | Text (not a B4P date) | 25-12-2024 | Two subtractions, results in 2011 |
true | Boolean value | ||
True | Text |
echo( Hello World );
echo( Hello World ); // Same as above (Spaces outside the strings are ignored, so are multiple spaces inside)
echo( One + One ); // + sign is an operator, result is 'OneOne'
echo( 'One + One' ); // This one is OK.
echo( Baden-Baden ); // Empty string. Hyphen is treated as minus sign (subtraction of strings)
echo( 'Baden-Baden' ); // This one is OK.
echo( 1. 23 ); // This is a string because a space is inside.
echo( 1 200 ); // Same here. Use function 'clean numeral' to extract 1200 as a number from here
echo( Dial 555 1212 );
echo( this is on, new line, the next line ); // new line is a reserved keyword
echo( Café in Zürich ); // Foreign characters inside
echo( . ); // Lone point
echo( . . . ); // A string containing 3 lone points (. . .), also showing how spaces are collapsing
// echo( .. ); // Would cause an error because .. is a b4p language symbol.
echo( '..' ); // This one is OK
echo( new line, Line 1, new line, Line 2 );
Hello World
Hello World
OneOne
One + One
Baden-Baden
1. 23
1 200
Dial 555 1212
this is on
the next line
Café in Zürich
.
. . .
..
Line 1
Line 2
Text inside single quotation marks
Text inside double quotation marks