derez Expert Licensed User Longtime User Dec 22, 2010 #1 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 Click to expand... for these lines Code: 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: Dec 22, 2010
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 Click to expand... for these lines Code: 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))
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2010 #2 "zplus" is a string. zplus is a variable (don't see all your code so I'm not sure...). Code: vw = Array As View(zplus, zminus, ...) Upvote 0
"zplus" is a string. zplus is a variable (don't see all your code so I'm not sure...). Code: vw = Array As View(zplus, zminus, ...)
derez Expert Licensed User Longtime User Dec 23, 2010 #3 Code: 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 61.2 KB · Views: 727 Upvote 0
Code: 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
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2010 #4 You are correct. You can either store it in an array of buttons or add them to a list instead of an array. Upvote 0
You are correct. You can either store it in an array of buttons or add them to a list instead of an array.
derez Expert Licensed User Longtime User Dec 23, 2010 #5 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
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.
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2010 #6 It will be fixed in the next version. For now Array keyword doesn't deal with this types conversion correctly. Upvote 0
It will be fixed in the next version. For now Array keyword doesn't deal with this types conversion correctly.
derez Expert Licensed User Longtime User Dec 23, 2010 #7 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
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...