Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
26
Task/Array-concatenation/FreeBASIC/array-concatenation.basic
Normal file
26
Task/Array-concatenation/FreeBASIC/array-concatenation.basic
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
Sub ConcatArrays(a() As String, b() As String, c() As String)
|
||||
Dim aSize As Integer = UBound(a) - LBound(a) + 1
|
||||
Dim bSize As Integer = UBound(b) - LBound(b) + 1
|
||||
Dim cSize As Integer = aSize + bSize
|
||||
Redim c(0 To cSize - 1)
|
||||
Dim i As Integer
|
||||
For i = 0 To aSize - 1
|
||||
c(i) = a(LBound(a) + i)
|
||||
Next
|
||||
For i = 0 To bSize - 1
|
||||
c(UBound(a) + i + 1) = b(LBound(b) + i)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Dim a(3) As String = {"The", "quick", "brown", "fox"}
|
||||
Dim b(4) As String = {"jumped", "over", "the", "lazy", "dog"}
|
||||
Dim c() As String
|
||||
ConcatArrays(a(), b(), c())
|
||||
For i As Integer = LBound(c) To UBound(c)
|
||||
Print c(i); " ";
|
||||
Next
|
||||
Print : Print
|
||||
Print "Press any key to quit the program"
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue