Android Question How to return a list from a sub

Derek Johnson

Active Member
Licensed User
Longtime User
I want to return a list from a sub and I'm getting the error "Array Expected"

Update: Figured the answer - no brackets needed in Mylist = GetList()



B4X:
Sub Test

    Dim MyList As List
    MyList = GetList()

End Sub

Sub GetList() As List

Dim x As List
x.Initialize
Return x

End Sub

So GetList returns a list, and in Test that list is assigned to MyList.

What should the code really be?
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…