|
|
|
|
By Andrew J. Wozniewicz
Milwaukee, August 6, 2008
The project below illustrates how to output a large amount of text without
having to type a whole lot of extra syntax. This could be useful, for
example, when generating HTML, or printing a lot of status/progress
messages.
Things like this are much more difficult in other languages...
In WANTScript:
- String literals are considered automatically terminated
at the end of the line.
- Auto-terminated string literals do not normally include the end-of-line characters.
- Two or more string literals following each other
are automatically concatenated and considered a single string literal.
- If the two string literals are on separate lines, an end-of-line sequence will
be inserted between them.
- A string literal by itself, in place of a statement within a module,
is an implicit call to System.IO.Console.WriteLn().
Here is the project that illustrates all of the above points:
project Test141
WriteLn("BEGIN")
"Gallia est omnis divisa in partes tres, quarum
"unam incolunt Belgae, aliam Aquitani, tertiam
"qui ipsorum lingua Celtae, nostra Galli appellantur.
"Hi omnes lingua, institutis, legibus inter se differunt.
"
"Gallos ab Aquitanis Garumna flumen, a Belgis
"Matrona et Sequana dividit.
"
"Horum omnium fortissimi sunt Belgae, propterea quod
"a cultu atque humanitate provinciae longissime absunt,
"minimeque ad eos mercatores saepe commeant atque ea
"quae ad effeminandos animos pertinent important,
"proximique sunt Germanis, qui trans Rhenum incolunt,
"quibuscum continenter bellum gerunt. Qua de causa
"Helvetii quoque reliquos Gallos virtute praecedunt,
"quod fere cotidianis proeliis cum Germanis contendunt,
"cum aut suis finibus eos prohibent aut ipsi in
"eorum finibus bellum gerunt.
WriteLn("END")
end
The output is:
BEGIN
Gallia est omnis divisa in partes tres, quarum
unam incolunt Belgae, aliam Aquitani, tertiam
qui ipsorum lingua Celtae, nostra Galli appellantur.
Hi omnes lingua, institutis, legibus inter se differunt.
Gallos ab Aquitanis Garumna flumen, a Belgis
Matrona et Sequana dividit.
Horum omnium fortissimi sunt Belgae, propterea quod
a cultu atque humanitate provinciae longissime absunt,
minimeque ad eos mercatores saepe commeant atque ea
quae ad effeminandos animos pertinent important,
proximique sunt Germanis, qui trans Rhenum incolunt,
quibuscum continenter bellum gerunt. Qua de causa
Helvetii quoque reliquos Gallos virtute praecedunt,
quod fere cotidianis proeliis cum Germanis contendunt,
cum aut suis finibus eos prohibent aut ipsi in
eorum finibus bellum gerunt.
END
-Andrew
|