30 lines
712 B
Plaintext
30 lines
712 B
Plaintext
' FB 1.05.0 Win64
|
|
|
|
Function min(x As Integer, y As Integer) As Integer
|
|
Return IIf(x < y, x, y)
|
|
End Function
|
|
|
|
Dim arr1(1 To 3) As String = {"a", "b", "c"}
|
|
Dim arr2(1 To 3) As String = {"A", "B", "C"}
|
|
Dim arr3(1 To 3) As Integer = {1, 2, 3}
|
|
|
|
For i As Integer = 1 To 3
|
|
Print arr1(i) & arr2(i) & arr3(i)
|
|
Next
|
|
|
|
Print
|
|
|
|
' For arrays of different lengths we would need to iterate up to the mimimm length of all 3 in order
|
|
' to get a contribution from each one. For example:
|
|
|
|
Dim arr4(1 To 4) As String = {"A", "B", "C", "D"}
|
|
Dim arr5(1 To 2) As Integer = {1, 2}
|
|
|
|
Dim ub As Integer = min(UBound(arr1), min(UBound(arr4), UBound(arr5)))
|
|
For i As Integer = 1 To ub
|
|
Print arr1(i) & arr2(i) & arr3(i)
|
|
Next
|
|
|
|
Print
|
|
Sleep
|