Android Question Array error

RobRock92

Member
Licensed User
Longtime User
with this code I came out this error : current declaration does not match previous one...How can i fix it?

B4X:
Sub cercarigavuota(codice As String)
Dim art() As Label
art = Array As Label(art1,art2,art3,art4,art5,art6,art7,art8,art9,art10,art11,art12,art13,art14,art15)
Dim ris As Int
For i = 14 To 0 Step -1
    If art(i).Text = "" OR art(i).Text = codice Then
    ris = i
    End If
Next
Return ris

End Sub
 

RobRock92

Member
Licensed User
Longtime User
B4X:
Parsing code.                          0.02
Compiling code.                        Error
Error compiling program.
Error description: Current declaration does not match previous one.
Previous: {Type=art,Rank=0}
Current: {Type=Label,Rank=1}
Occurred on line: 135
Dim art() As Label

and i declared "art() as label" under sub globals and
"art = Array As Label(art1,art2,art3,art4,art5,art6,art7,art8,art9,art10,art11,art12,art13,art14,art15)" under activity create
 
Upvote 0

RobRock92

Member
Licensed User
Longtime User
I found the error , because I was also the activity that was called art ... i change the name of array and it work!!!
thank you very much erel!!!
 
Upvote 0
Top