You must be remembering a different language. Concatenation is done simply using the "+" operator.
For instanceCode: QB64: [Select]
Concatenation uses the + addition symbol to add literal or variable parts to a string variable value.
@paranoia1001001
Yes, you can use the "+" with string variables.
From the Wiki page on STRING:
It works on string expressions, which includes string literals, string variables, and functions that return strings (e.g. CHR$(13) + CHR$(10)).
Please correct my memory if I am wrong, but wasn't there a concatenate() or concat() function in QBasic? I've been unable to find any information on the QB64 Wiki about any such function in QB64 or QBasic. Am I just remembering another language from long ago?
Code: QB64: [Select]
testarray(1) = "This is" testarray(2) = " a " testarray(3) = "test" concatenated = concatenated + stringarray(x) concat = concatenated
There are obviously some smart people here. OK, if you want a challenge the function (from whatever language it came, thinking VB right now but not sure) was able to take any number of strings as arguments and concatenate them, similar to our very simple tacking on of "+"'s ad infinitum. Have at it!
Concat : Concatenates two or more stringshttp://www.baskent.edu.tr/~tkaracay/etudio/ders/prg/pascal/PasHTM1/pas/pasl1007.html (http://www.baskent.edu.tr/~tkaracay/etudio/ders/prg/pascal/PasHTM1/pas/pasl1007.html)
Syntax : concat(s1,s2,...,sn)
Example : st:=concat(s1,s2);
If s1='ABC' and s2='DEF', st would be 'ABCDEF'
st:=concat('Borland ','Pascal ','ver. ','7.0'); Would be 'Borland Pascal ver. 7.0'
You may put as many parameters to concat as possible. If the resulting string length is more than 255, it will be truncated to 255.
Concat is the same if we use plus sign (+). For example :
st:=concat('ABC','DEF'); is the same as st:='ABC'+'DEF'
Function Concat(s1 [, s2, s3...sn] : String) : String;https://www.pascal-programming.info/lesson10.php#jump7 (https://www.pascal-programming.info/lesson10.php#jump7)
Description
Concatenates 2 or more strings depending how long is the argument expression. Try to make sure not to exceed the limit of 255 characters when concatening strings as it will result in truncation. This function can also be obtained by using the plus (+) operator between strings that need to be concatenated.
Var
S1, S2 : String;
Begin
S1 := 'Hey!';
S2 := ' How are you?';
Write(Concat(S1, S2)); { 'Hey! How are you?' }
End.
is the same
Var
S1, S2 : String;
Begin
S1 := 'Hey!';
S2 := ' How are you?';
Write(S1 + S2); { 'Hey! How are you?' }
End.