Task

Show how to concatenate two arrays in your language.



If this is as simple as array1 + array2, so be it.




 
 
Dim As Integer First, Second
First = 5: Second = 8
 
Dim As Integer Array1(1 To First), Array2(1 To Second), ArrayResult(1 To First + Second)
 
 
Init Array1(), 2
Print "First array"
ShowArr Array1()
Sleep 2
Print "Second array"
Init Array2(), 5
ShowArr Array2()
Sleep 2
Print "Final array"
 
ConcatArray Array1(), Array2(), ArrayResult()
ShowArr ArrayResult()
End
 
Sub Init (A() As Integer, R As Integer)
    Dim Index As Integer
    For Index = 1 To UBound(a)
        A(Index) = Index * R
    Next
End Sub
 
Sub ShowArr (A() As Integer)
    Dim Index As Integer
    For Index = 1 To UBound(a)
        Print A(Index)
    Next
End Sub
 
Sub ConcatArray (A() As Integer, B() As Integer, R() As Integer)
    Dim Index As Integer
    For Index = 1 To UBound(a)
        R(Index) = A(Index)
    Next
    For Index = (1) To (UBound(b))
        R(Index + UBound(a)) = B(Index)
    Next
End Sub
 
 