String concatenation: Difference between revisions

Content added Content deleted
imported>Arakov
(An alternate version w/o using the console, different way of declaring string datatypes.)
Line 1,917: Line 1,917:


=={{header|PureBasic}}==
=={{header|PureBasic}}==
<syntaxhighlight lang="purebasic">If OpenConsole()
<syntaxhighlight lang="basic">
If OpenConsole()

s$ = "hello"
s$ = "hello"
PrintN( s$ + " literal")
PrintN( s$ + " literal")
Line 1,928: Line 1,928:
CloseConsole()
CloseConsole()
EndIf</syntaxhighlight>
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}}==
=={{header|Python}}==