List & Errors

luke2012

Well-Known Member
Licensed User
Longtime User
Hi to All,
Im trying to do a sub that implement a popup using the thedesolatesoul's library (Id) but I got an error (see the attached file).

Code :

Dim ArrRoles(1) As String
ArrRoles(0)="Cameriere"
ArrRoles(1)="Titolare"

Dim ret As Int
ret=Popup(ArrRoles,"Role")

Sub Popup (Arr, Title As String) As Int
Dim RolePop As id 'Id is a library that implement a popup
Dim lstChoice As List
Dim ret As Int

lstChoice.Initialize
lstChoice.AddAll(Arr)
ret = RolePop.InputList1(lstChoice,Title)
Return ret
End Sub
 

Attachments

  • error.png
    error.png
    16.6 KB · Views: 268

kickaha

Well-Known Member
Licensed User
Longtime User
Try this code
B4X:
Dim ArrRoles(2) As String
ArrRoles(0)="Cameriere"
ArrRoles(1)="Titolare"

Dim ret As Int
ret=Popup(ArrRoles,"Role")

Sub Popup (Arr () As String, Title As String) As Int
Dim RolePop As id 'Id is a library that implement a popup
Dim lstChoice As List 
Dim ret As Int

lstChoice.Initialize
lstChoice.AddAll(Arr)
ret = RolePop.InputList1(lstChoice,Title)
Return ret
End Sub
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
The error is solved but the app crashes :-(

My final code is this :

Sub Activity_Create(FirstTime As Boolean)
Dim ret As Int
ret=shared.Popup(ArrRoles,"Ruolo")
Activity.LoadLayout("lyoHome")


'SQLEngine.Initialize(File.DirInternal,"pizzeria.db",False)
'SQLTableReadColumnNames (SQLEngine,"tab_pizze")
End Sub

*** shared is a code module that contains the Popup sub
 
Upvote 0
Top