Ok, I'm getting very confused with arrays and hwo they work differently depending on contexte:
Code A:
Local txtMonth_Full:String[][]= ..
[..
["January","February","March","April","May","June","July","August","September","October","November","December"],..
["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]..
]
Local tStr:String
tStr = txtMonth_Full[1][1]
Print tStr
Code B:
Local T:Test
T = New Test
T.P
Type Test
Global txtMonth_Full:String[][]= ..
[..
["January","February","March","April","May","June","July","August","September","October","November","December"],..
["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]..
]
Field tStr:String
Function P()
tStr = txtMonth_Full[1][1]
Print tStr
End Function
End Type
So, code B is code A nested in a type, code B does not compile yet code A does. Says its returning an Int and cant convert to String.
Furthermore, my complete project gives a different error than code B, says my field txtMonth_Full isnt declared. And i have no other errors if i comment out the
tStr = txtMonth_Full[1][1]
part. And its declared the same way i did it in Code B or Code A. (of course, Field for B, Local for A)
I fixed the issue by making it Global (which is what i should have been) but i'm still worried about why the issue happened. Frankly, i dont see how code B does not work if code A works.
Code A:
Local txtMonth_Full:String[][]= ..
[..
["January","February","March","April","May","June","July","August","September","October","November","December"],..
["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]..
]
Local tStr:String
tStr = txtMonth_Full[1][1]
Print tStr
Code B:
Local T:Test
T = New Test
T.P
Type Test
Global txtMonth_Full:String[][]= ..
[..
["January","February","March","April","May","June","July","August","September","October","November","December"],..
["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]..
]
Field tStr:String
Function P()
tStr = txtMonth_Full[1][1]
Print tStr
End Function
End Type
So, code B is code A nested in a type, code B does not compile yet code A does. Says its returning an Int and cant convert to String.
Furthermore, my complete project gives a different error than code B, says my field txtMonth_Full isnt declared. And i have no other errors if i comment out the
tStr = txtMonth_Full[1][1]
part. And its declared the same way i did it in Code B or Code A. (of course, Field for B, Local for A)
I fixed the issue by making it Global (which is what i should have been) but i'm still worried about why the issue happened. Frankly, i dont see how code B does not work if code A works.