Derek Johnson Active Member Licensed User Longtime User Oct 12, 2017 #1 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: Oct 12, 2017
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?
klaus Expert Licensed User Longtime User Oct 12, 2017 #2 This is wrong: MyList = GetList() It should be: MyList = GetList Upvote 0