Sub load_selected_movie_list
'
Dim dumstr As String, mypattern As String, mystr(10) As String
'
txt_file="movie_list.txt"
mypattern=","
'
txt_reader.Initialize(File.OpenInput(File.DirAssets ,txt_file))
'
txt_line1=txt_reader.ReadLine
txt_line2=txt_line1
'
Do While txt_line2 <> Null
'
'mysubs=Regex.Split(mypattern,txt_line2)
'
nfound=barry_parser(txt_line2,mysubs)
dumstr=mysubs(5)
'
' if I add line below then it works fine ...
' so must have something to do with the mysubs string
' or the Regex.split .... but when it crashes
' the Sub cstr_int diagnostics show NICE numerical strings ...
'
' memory pointers to strings must be getting lost ???
'
' dumstr="234"
'
int_mins=cstr_int(mysubs(5))
'
' change to this line
'
' int_mins=cstr_int(dumstr)
'
' and still crashes
'
txt_line2=txt_reader.ReadLine
'
Loop
'
txt_reader.close
'
Log("finished pass " & ipass)
' '
End Sub
Sub cstr_int(mystr As String) As Int
'
Dim myint As Int, mys As String
mys= mystr
If(make_it_work=1) Then mys=mys & " "
'
Try
myint=mys
Catch
Log("string hassle >" & mys & "< " & mys.Length)
Try
myint=mys
Catch
Log("tried again")
myint=mys
Log ("done 2nd time")
End Try
Log("done")
End Try
Return myint
'
End Sub
Sub barry_parser(mystr As String, mybits() As String) As Int
'
Dim indx As Int, start_indx As Int, inum As Int
'
indx=mystr.IndexOf(",")
start_indx=-1
inum=-1
Do While indx >= 0 AND inum < 10
inum=inum+1
mybits(inum)=mystr.SubString2(start_indx+1,indx)
start_indx=indx
indx=mystr.IndexOf2(",",start_indx+1)
Loop
inum=inum+1
mybits(inum)=mystr.SubString(start_indx+1)
Return inum+1
'
End Sub