I"m pretty sure I have the correct amount of End If's here, but whenever I save it I get a syntax error for the End While line. If I tack three End If's on the end before the end while, then the error goes away, but I become more confused. I just started re-writing my app all over again and this is really frustrating me. Wish there was some proper "Unterminated If on Line #X" error messages from the compiler.
There may be other issues in this code, but I'm only concerned about writing proper
if then else else if end if statements.
function posterscr(posterlist as object) as object
poster.SetListDisplayMode("best-fit")
poster.SetContentList(PosterList)
' if isauthenticated then
' categories=["Search","Explore", "Tracks", "About","You"]
' else
categories=["Search","Explore"," Tracks","About"]
' end if
poster.SetListNames(categories)
poster.SetListStyle("flat-category")
poster.SetListDisplayMode("best-fit")
poster.SetFocusedList(0)
poster.SetFocusedListItem(0)
poster.show()
while true
msg=wait(0,port)
msgtype=type(msg)
message=msg.getmessage()
idx = msg.GetIndex()
if type(msg) = "roPosterScreenEvent" then
if msg.isScreenClosed() then
print "screen closed exit app"
return -1
end if
if msg.islistSelected() and idx=5 and isauthenticated=false then
authenticate()
return -1
end if
if msg.isListFocused() then
m.currentcategory=idx ' assign category to global variable
'figure out which category was selected
if idx = 0 then
print "search selected"
' handle search section selected
else if idx = 1 then
print "explore selected"
'handle explore section selected
else if idx = 2 then
print "top tracks selected"
'handle top tracks selected
'call display top tracks
else if idx = 3 then
print "about this app selected"
'show the about screen
end if
end if
if msg.isListItemSelected() then
if m.currentcategory = 0 then 'we are in search section
if idx = 0 then
posterlist.Append(searchTracks())
end if
if idx = 1 then
posterlist.Append(searchPeople())
end if
if idx = 2 then
posterlist.Append(searchGroups())
end if
if idx = 3 then
posterlist.Append(searchGenre())
end if
else
if m.currentcategory=1 then 'we are in Explore section
print "explore section bla bla"
else if m.currentcategory=2 then 'we are in Hot section
posterlist.SetContentList(GetHotStuff())
else if m.currentcategory=3 then 'we are in about section
posterlist.setContentList(About())
else if m.currentcategory=4 then 'we are in you section
print "its all you babe"
end if
end if
end while
end function
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!