Jump to content

Literals/String: Difference between revisions

Lingo added
m (added whitespace before the TOC (table of contents), added a ;Task: (bold) header, added bullet points, added other whitespace and highlighting to the task's preamble.)
(Lingo added)
Line 1,024:
print chr$(34);"Hello, World.";chr$(34)
</lang>
 
=={{header|Lingo}}==
* Lingo only supports single quotes for string literals. Single quotes in string lirerals have to be replaced by "&QUOTE&":
<lang lingo>str = "Hello "&QUOTE&"world!"&QUOTE
put str
-- "Hello "world!""</lang>
 
* Lingo does not support heredoc syntax, but only multiline string literals by using the line continuation character "\":
<lang lingo>str = "This is the first line.\
This is the second line.\
This is the third line."</lang>
 
* Lingo does not support automatic variable expansion in strings. But the function value() can be used to expand template strings in the current context:
<lang lingo>template = QUOTE&"Milliseconds since last reboot: "&QUOTE&"&the milliseconds"
 
-- expand template in current context
str = value(template)
put str
-- "Milliseconds since last reboot: 20077664"</lang>
 
=={{header|Lisaac}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.