Quoting constructs: Difference between revisions

Applesoft BASIC
(Applesoft BASIC)
Line 112:
 
For quoting binary data in another file, you can use the <code>incbin</code> directive to embed it directly in your source code. This is handy for graphics data and music.
=={{header|Applesoft BASIC}}==
Real precision numbers (also called "floating point" numbers) and quoted strings are constructs within expressions. Literal strings, real precision numbers, and quoted strings are contructs within DATA statements.
 
Numbers start with a digit from 0 to 9 or a sign + or - and can include a two digit signed exponent. The real numbers must be in the range from -1.7E+38 to 1.7E+38. Reals with an absolute value less than 2.9388E-39 are converted to zero.
 
Quoted strings start with the double quote. Quoted strings are terminated with the double quote or by the end of a statement. A quote cannot be embedded in a quoted string. Most control characters can be embedded in quoted strings, but this is usually discouraged.
 
Literals can be used in DATA statments. These are strings that do not start with a double quote and can have a double quote included in the literal string.
 
=== Quoted constructs within expressions ===
 
<lang>? 0 : ? -326.12E-5 : ? HELLO : ? "HELLO" : ? "HELLO</lang>
The literal HELLO is interpreted as a variable name, and it's value 0 is printed.
{{out}}
<pre>
0
-3.2612E-03
0
HELLO
HELLO
</pre>
=== Quoted constructs within DATA statements ===
<lang> 10 DATA 0,-326.12E-5,HELLO,"HELLO","HELLO
20 READ A%: PRINT A%: READ A: PRINT A: READ A$: PRINT A$: READ A$: PRINT A$: READ A$: PRINT A$
30 DATA AB"C
40 READ A$: PRINT A$</lang>
{{out}}
<pre>
0
-3.2612E-03
HELLO
HELLO
HELLO
AB"C
</pre>
=={{header|BQN}}==
 
413

edits