Thank you for your input. I am afraid this still has a way to run yet.
I tried using digits and it does not cure the problem.
In fact, with the arrays declared with variables, I pause the program in debug and when I hover the mouse over the array name, all the content of the array is shown in the mouse hint, proving that the array has been created correctly.
Naturally I commented the receiving Sub out because this is a compile error not a runtime error.
Whilst I accept there is an easy alternative in passing another variable
I really need to find the reason for this problem to do with 'double' when it is declared as Int.
For clarity I have isolated the code, simplified and rewritten as a test...
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim aFred(4,4), aTom(4,4) As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
aFred(0,0)=1 : aTom(0,0)=2
Test(aFred)
End Sub
Sub Test(aWhich(,) As Int)
Dim b As Int
b=0
If (aWhich=aFred) Then b=1
End Sub
The error suggests that aWhich should be Double not Int. The little arrow should be under the 4th open parenthesis.
Compiling code. 0.02
Generating R file. 0.00
Compiling generated Java code. Error
B4A line: 30
If (aWhich=aFred) Then b=1
javac 1.6.0_26
src\Tests\Test1\main.java:335: inconvertible types
found : int[][]
required: double
if ((_awhich==(double)(_afred))) {
^
1 error
In Java this works OK
void Test(int[][] which){
b=(which==grid)?0:b;
Surely somebody has used this same technique without problem, if not, then a bug?