String concatenation: Difference between revisions

An alternate version w/o using the console, different way of declaring string datatypes.
imported>Arakov
(An alternate version w/o using the console, different way of declaring string datatypes.)
Line 1,917:
 
=={{header|PureBasic}}==
<syntaxhighlight lang="purebasicbasic">If OpenConsole()
If OpenConsole()
 
s$ = "hello"
PrintN( s$ + " literal")
Line 1,928:
CloseConsole()
EndIf</syntaxhighlight>
 
{{out}}
<pre>
hello literal
hello literal
</pre>
 
This version uses the debugger versus outputting to the console. It
implements 'EnableExplicit' which is similar to VisuaBasic's 'Option Explicit' which means all variables must be declared. It also features the use of string variables WITHOUT the dollar-sign suffix '$' which is common in BASIC variants to indicate the string datatype:
<syntaxhighlight lang="basic">
EnableExplicit
 
Define.s s1, s2, s3
 
s1 = "Hello "
s2 = "World"
s3 = s1 + s2
Debug s3
s3 = s3 + "!"
Debug s3
</syntaxhighlight>
 
{{out}}
<pre>
Hello World
Hello World!
</pre>
 
=={{header|Python}}==
57

edits