String interpolation (included): Difference between revisions
Content added Content deleted
m (→{{header|Quackery}}: replaced a note in the (accidentally duplicated/just removed) Quackery entry) |
(Added various BASIC dialects) |
||
Line 687: | Line 687: | ||
=={{header|BASIC}}== |
=={{header|BASIC}}== |
||
==={{header|Applesoft BASIC}}=== |
|||
<syntaxhighlight lang="qbasic">10 x$ = "big" |
|||
20 print "Mary had a "; x$; " lamb"</syntaxhighlight> |
|||
==={{header|BASIC256}}=== |
==={{header|BASIC256}}=== |
||
<syntaxhighlight lang="basic256">x$ = "big" |
<syntaxhighlight lang="basic256">x$ = "big" |
||
Line 693: | Line 697: | ||
x$ = "little" |
x$ = "little" |
||
print "Mary also had a "; ljust(x$, length(x$)); " lamb"</syntaxhighlight> |
print "Mary also had a "; ljust(x$, length(x$)); " lamb"</syntaxhighlight> |
||
==={{header|Chipmunk Basic}}=== |
|||
{{works with|Chipmunk Basic|3.6.4}} |
|||
<syntaxhighlight lang="qbasic">10 x$ = "big" |
|||
20 print "Mary had a "; x$; " lamb"</syntaxhighlight> |
|||
==={{header|GW-BASIC}}=== |
|||
{{works with|PC-BASIC|any}} |
|||
{{works with|BASICA}} |
|||
{{works with|QBasic}} |
|||
{{works with|MSX BASIC}} |
|||
<syntaxhighlight lang="qbasic">10 X$ = "big" |
|||
20 PRINT "Mary had a "; X$; " lamb" |
|||
30 X$ = "little" |
|||
40 PRINT USING "Mary also had a & lamb"; X$ |
|||
50 END</syntaxhighlight> |
|||
==={{header|Minimal BASIC}}=== |
|||
<syntaxhighlight lang="qbasic">10 LET X$ = "BIG" |
|||
20 PRINT "MARY HAD A "; X$; " LAMB" |
|||
30 END</syntaxhighlight> |
|||
==={{header|MSX Basic}}=== |
|||
{{works with|MSX BASIC|any}} |
|||
The [[#GW-BASIC|GW-BASIC]] solution works without any changes. |
|||
==={{header|QBasic}}=== |
==={{header|QBasic}}=== |
||
Line 701: | Line 730: | ||
' this code above doesn't modify the first string subsustituting a piece of it with another string |
' this code above doesn't modify the first string subsustituting a piece of it with another string |
||
'surely it gives the right output on the screen</syntaxhighlight> |
'surely it gives the right output on the screen</syntaxhighlight> |
||
==={{header|Quite BASIC}}=== |
|||
<syntaxhighlight lang="qbasic">10 LET X$ = "BIG" |
|||
20 PRINT "Mary had a "; x$; " lamb"</syntaxhighlight> |
|||
==={{header|True BASIC}}=== |
==={{header|True BASIC}}=== |
||
Line 712: | Line 745: | ||
PRINT "Mary also had a "; outstring$; " lamb" |
PRINT "Mary also had a "; outstring$; " lamb" |
||
END</syntaxhighlight> |
END</syntaxhighlight> |
||
==={{header|XBasic}}=== |
|||
{{works with|Windows XBasic}} |
|||
<syntaxhighlight lang="qbasic">PROGRAM "String append" |
|||
VERSION "0.0000" |
|||
DECLARE FUNCTION Entry () |
|||
FUNCTION Entry () |
|||
X$ = "big" |
|||
PRINT "Mary had a "; X$; " lamb" |
|||
END FUNCTION |
|||
END PROGRAN</syntaxhighlight> |
|||
==={{header|Yabasic}}=== |
==={{header|Yabasic}}=== |