Look at this (artificial) sample:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
Option Explicit
Public Sub Command1_Click()
Dim arr(10) As PictureBox
Dim i As Integer
Dim s As String
For i = 1 To 10
arr(i) = New PictureBox
Next i
For i = 1 To 10
arr(i).ToolTip = i
Next i
s = ""
For i = 10 To 1 Step -1
s = s & " " & arr(i).ToolTip
Next i
MsgBox s
End Sub
|
The sample shows how to define and fill an array of object references,
You have used the "as new Class1" syntax which is only allowed for simple variables.
So, the Jabaco bug is that it does not warn you in this case.
I might be wrong but "MyEntry[2]" does not look like a valid variable name to me.
Variable names have to start with an alphabetical character.
The other characters can be alphabetical or numerical, but I have never seen squared brackets
in a Jabaco source code.
It is an interesting feature you have discovered: Jabaco allows direct definition of Java arrays
using the DIM xxx[n] notation with squared brackets. In contrast "Dim b(7)" with round brackets is compiled into
something like:
|
Jabaco Source
|
1
2
|
VBA.VBArrayDouble b = new VBArray();
b.setBound(0, 7, false);
|
I've tried the following Jabaco code:
|
Jabaco Source
|
1
2
3
4
5
|
Dim a[1] As Integer
Dim a[2] As Integer
Dim a[3] As Integer
a[1] = 0
|
It is compiled to the following Java code:
|
Jabaco Source
|
1
2
3
4
5
|
int a[1] = 0;
int a[2] = 0;
int a[3] = 0;
a[1] = 0;
|
Basically, the sample defines
one array with 3 int entries.
However, this is not valid Java. Tools like Eclipse won't accept it.
In Java, it is not allowed to have local variables with duplicate names.
A proper array definition would look as follows:
|
Jabaco Source
|
1
2
3
|
int a[] = new int[1];
a[0] = 0;
|
Greetings
A1880