The PowerBuilder concatenation operator joins the contents of two variables of the same type to form a longer value. You can concatenate strings and blobs.
The following table shows the concatenation operator.
Operator |
Meaning |
Example |
---|---|---|
+ |
Concatenate |
|
Example 1 These examples concatenate several strings:
string Test
Test = "over" + "stock" // Test contains "overstock"
string Lname, Fname, FullName
FullName = Lname + ', ' + Fname
// FullName contains last name and first name,
// separated by a comma and space.
Example 2 This example shows how a blob can act as an accumulator when reading data from a file:
integer i, fnum, loops
blob tot_b, b
. . .
FOR i = 1 to loops
bytes_read = FileRead(fnum, b)
tot_b = tot_b + b
NEXT