Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Source code |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
Public Sub Command1_Click() Dim arr(1 To 3, 2 To 4, 5 To 7) As Integer Dim b() As Integer msgbox "arr " _ & Lbound(arr, 1) & " .. " & Ubound(arr,1) & ", " _ & Lbound(arr, 2) & " .. " & Ubound(arr, 2) & ", " _ & Lbound(arr, 3) & " .. " & Ubound(arr, 3) Redim b(5 To 7, 2 To 4, 1 To 3) msgbox "b " _ & Lbound(b, 1) & " .. " & Ubound(b, 1) & ", " _ & Lbound(b, 2) & " .. " & Ubound(b, 2) & ", " _ & Lbound(b, 3) & " .. " & Ubound(b, 3) Redim Preserve arr(5 To 7, 2 To 4, 1 To 3) msgbox "arr p " _ & Lbound(arr, 1) & " .. " & Ubound(arr,1) & ", " _ & Lbound(arr, 2) & " .. " & Ubound(arr, 2) & ", " _ & Lbound(arr, 3) & " .. " & Ubound(arr, 3) ' the following statement results in a crash Redim arr(5 To 7, 2 To 4, 1 To 3) ' ' Jabaco compiles it to: ' arr.setBound(1, 3, false); arr.addDimension(2, 4, false); arr.addDimension(5, 7, false); ' msgbox "arr " _ & Lbound(arr, 1) & " .. " & Ubound(arr, 1) & ", " _ & Lbound(arr, 2) & " .. " & Ubound(arr, 2) & ", " _ & Lbound(arr, 3) & " .. " & Ubound(arr, 3) End Sub |
This post has been edited 2 times, last edit by "A1880" (Mar 6th 2009, 1:23pm)
Jabaco Source |
|
1 |
Dim arr(1 To 3, 2 To 4, 5 To 7) As Integer |
Jabaco Source |
|
1 |
ReDim arr(1 To 3, 2 To 4, 5 To 7) As Integer |
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Source code |
|
1 2 |
ReDim arrD(1 To 3, 2 To 4, 5 To 7) As Integer |
Jabaco Source |
|
1 |
ReDim arr(1 To 3, 2 To 4, 5 To 7) As Integer |
Jabaco Source |
|
1 2 |
Dim arr() As Integer ReDim arr(1 To 3, 2 To 4, 5 To 7) |
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Jabaco Source |
|
1 2 3 4 5 6 7 8 |
Public Sub Command3_Click() Dim List As New java#util#ArrayList Dim i As Integer For i = 0 To 10 List.add(i) Next MsgBox CStr(List.size) End Sub |
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Public Sub Command3_Click() Dim List As New java#util#ArrayList Dim i As Integer For i = 0 To 10 List.add(i) Next MsgBox CStr(List.size) MsgBox "List.contains(5): " & List.contains(5) 'for "contains" the associative Hashtable is better: Dim dic As New java#util#Hashtable dic.put("Apfel", "Apfel") dic.put("Birne", "Birne") dic.put("Melone", "Melone") dic.put("Kiwi", "Kiwi") dic.put("Kirsche", "Kirsche") If dic.containsKey("Melone") Then MsgBox dic.get("Melone") End If End Sub |
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves