array of views

derez

Expert
Licensed User
Longtime User
I get the following error:
Compiling code. 0.08
Generating R file. 0.00
Compiling generated Java code. Error
B4A line: 97
vw = Array As View(\
javac 1.6.0_22

for these lines
B4X:
Dim vw() As View
vw = Array As View("zplus","zminus","mark","tgtplus","tgtminus","scalelabel","rotate","stopwatch","visit")
in the list there are buttons, togglebuttons and a label.
I tried also without the quotes.

edit: I managed by single allocations: vw(0) = zplus ....
I tried to do the animation on the whole array but it works only by an indexed loop:
this failed: ani.start(vw) , this works: ani.start(vw(i))
 
Last edited:

derez

Expert
Licensed User
Longtime User
B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

   Dim Button1 As Button
   Dim Button2 As Button
   Dim Button3 As Button
   Dim vw(3) As View
End Sub

Sub Activity_Create(FirstTime As Boolean)
vw = Array As View(button1,button2,button3)
End Sub
 

Attachments

  • vw.jpg
    vw.jpg
    61.2 KB · Views: 396
Upvote 0

derez

Expert
Licensed User
Longtime User
Please elaborate, I don't understand why the array of views doesn't work when alocated using "Array" command, while it does accept the array when i assign the buttons one by one to the indexed item.
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Thank you.
My problem is usually to know if the error is mine or the SW. Once you tell me it is in your side I am relieved...
 
Upvote 0
Top