having declared two labels in Sub_Globals
why can't the the .text of these labels be read/written by each other.
They there in different subs, but in the same module.
getting an " should first be initialized err"
how can these values be passed between these labels?
Hi Erel,
I'm not using the designer at all.
Dimmed an array of 20 labels in Sub_Globals.
Assigned all their property's and initialized them in a sub
their .text values are being re-assigned in their _click subroutine
it's when I try to read/write their .text in a third sub the err accrues
it appears that this sub has no knowledge of the view
If SelectedPanel = 2 Then ' Copy value of selected meter to keyboard result box
'ERROR *******
Log(lbl.Tag)
lbl.Tag value is 14, and...
B4X:
'Create Meter Inputs labels
Cd.Initialize2 (Colors.ARGB (255,255,255,255),0,2, Colors.Black)
For X =0 To 13 <-------
lblMRinput(X).Initialize("MeterInput")
Thanks LucaMs,
So obvious!
lesson one. DON'T use public variables unless you have to!
I'm very grateful to all you experts out there, this community is very supportive.
'BELOW 2 LINES IN GLOBALS
Dim C1pr, Chem1pr, C2pr, Chem2pr, C3pr, Chem3pr, C4pr, Chem4pr, C5pr, Chem5pr As Label
Dim CChem() As Label
'Then after you load the layout in Activity_Create with these views, you enter this line:
CChem = Array As Label(C1pr, Chem1pr, C2pr, Chem2pr, C3pr, Chem3pr, C4pr, Chem4pr, C5pr, Chem5pr)
ok, but just not practical if you have say 20 or 30 or more views that you can define and implement with a few lines in a loop. i use the designer but often find that i end up altering their properties in code to the point where it might have been easier not to bother? i always start with the designer but with a complex project the end product bears no resemblance to the the layout, but that's just me!