iOS Question Problem with list

Discussion in 'iOS Questions' started by mrossen, Mar 26, 2015.

  1. mrossen

    mrossen Active Member Licensed User

    Hi,

    I have a dataset I get from a mysql database.

    If I get the data right I store the record in a txt file with file.writelist
    If I dont have data connection I read the dataset with file.readlist, but something seems not to be done right.

    I hope someone can see what I have made right

    I get no error but the app craches.

    Code:
    Sub JobDone(Job As HttpJob)
       
        
    Dim oldData, newData As String
        
    Dim partNoAll As String
           
        brand_cars.Initialize
           
        
    Dim lType As List
       
        lType.Initialize
       
       
       
        ListViewCars.TwoLinesLayout.Label.Textsize = 
    16
        ListViewCars.TwoLinesLayout.SecondLabel.Textsize = 
    14
       
           
        
    ProgressDialogHide
        
    If Job.Success Then
        
    Dim res As String
            res = Job.GetString
       
            
    Dim parser As JSONParser
            parser.Initialize(res)
            
    Select Job.JobName
                
    Case brand
               
                    brand_list = parser.NextArray 
    'returns a list with maps
                      
                    
    For i = 0 To brand_list.Size - 1
                        mAll = brand_list.Get(i)
                        partNoAll = mAll.Get(
    "partno")

                        newData = mAll.Get(
    "brand") & " - " & mAll.Get("model") & " - " & mAll.Get("engine") & " - " & mAll.Get("yearfrom") & " - " & mAll.Get("fuel") & " - " & mAll.Get("variant") & " - " & partNoAll.CharAt(5)
                                           
                        
    If newData <> oldData Then
                            brand_cars.Add(brand_list.Get(i))
                        
    End If
                           
                        oldData = mAll.Get(
    "brand") & " - " & mAll.Get("model") & " - " & mAll.Get("engine") & " - " & mAll.Get("yearfrom") & " - " & mAll.Get("fuel") & " - " & mAll.Get("variant")  & " - " & partNoAll.CharAt(5)
                       
                    
    Next
               
                    
    File.WriteList(File.DirRootExternal, "ListBrand.txt", brand_cars)
                   
                    getCars
                   
            
    End Select
        
    Else
            
    ToastMessageShow("No internet connection"True)
           

            brand_cars = 
    File.ReadList(File.DirRootExternal, "ListBrand.txt")
            getCars
           
           
        
    End If
        Job.Release

                       
                       
    End Sub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I think that you are asking about B4A, not B4i...
     
  3. mrossen

    mrossen Active Member Licensed User

    Last edited: Mar 26, 2015
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice