Array concatenation: Difference between revisions

Array concatenation en BASIC256
m (→‎{{header|C sharp}}: Regularize header markup to recommended on category page)
(Array concatenation en BASIC256)
Line 774:
160 : PRINT C(I);
170 NEXT</lang>
 
 
=={{header|BASIC256}}==
<lang basic256>arraybase 1
global c
 
dimen = 5
dim a(dimen)
dim b(dimen)
# Array initialization
for i = 1 to dimen
a[i] = i
b[i] = i + dimen
next i
 
nt = ConcatArrays(a, b)
 
for i = 1 to nt
print c[i];
if i < nt then print ", ";
next i
end
 
function ConcatArrays(a, b)
ta = a[?]
tb = b[?]
 
nt = ta + tb
redim c(nt)
 
for i = 1 to ta
c[i] = a[i]
next i
for i = 1 to tb
c[i + ta] = b[i]
next i
 
return nt
end function</lang>
{{out}}
<pre>1, 2, 3, 4, 5, 6, 7, 8, 9, 10</pre>
 
 
=={{header|BQN}}==
2,170

edits