Invalid value for left-side of expression. (runtime error &he4) in ...g:/source/appSearchScreen.brs(337)
337: m.titlehistorylist[j]=histemp[i]
m.titlehistorylist=histempbut I presume this is reversing the desired order...
function loadsearchHistory()
if not checkreg("history","search_title_hist") then
?"no title search history in the registry"
createregsection("history","search_title_hist", "")
m.titlehistorylist=""
else
?"found title search history, loading"
histemp=box(readreg("history","search_title_hist").tokenize(","))
i=histemp.count()-1
j=0
while true
if i=-1 or j > histemp.count() -1
exit while
end if
m.titlehistorylist[j]=histemp[i]
'm.titlehistorylist=histemp
i=i-1
j=j+1
end while
end if
end function
function update_title_history(histlist As Object, querystring As String) As Dynamic
flag=0
? "histlist = " Type(histlist)
? "querystring = " Type(querystring)
if islist(histlist) = false
? "setting histlist[0] to " querystring
histlist = CreateObject("roArray",1,1)
histlist[0] = querystring
else
? "looping over title history now"
for i=0 to histlist.count()-1
if querystring=histlist[i]
flag=1
end if
next i
if flag <> 1 then
histlist.unshift(querystring)
if histlist.count() > 9
histlist.pop()
end if
end if
end if
m.titlehistorylist=histlist
writereg("history","search_title_hist",arraytostring(histlist))
return histlist
end function
function loadsearchHistory()
if not checkreg("history","search_title_hist") then
?"no title search history in the registry"
createregsection("history","search_title_hist", "")
m.titlehistorylist=CreateObject("roArray", 1, true)
else
?"found title search history, loading"
histemp=box(readreg("history","search_title_hist").tokenize(","))
temp1=CreateObject("roArray", 1, true)
i=histemp.count()-1
j=0
while true
if i=-1 or j > histemp.count() -1
exit while
end if
'm.titlehistorylist[j]=histemp[i]
temp1[j]=histemp[i]
i=i-1
j=j+1
end while
m.titlehistorylist=temp1
end if
end function
m.titlehistorylist =CreateObject("roArray", 1, true)before entering the loop, then it works as expected. I thought that 'm.titlehistorylist' was already array at this point in the app, but apparently not.