What you could do is - check the search result.
ie
call your search routine as a function –
msg.isListItemSelected()
whatever check you use to determine it should pull up the search screen goes here
Result=SearchScreen()
Then for your search screen function return a value
Function SearchScreen() As String
If msg.isFullResult()
If LEN(msg.GetMessage())>0 Then Return msg.GetMessage() 'if the search term value is greater than 0 characters, then return the search term to the calling function
And then jumping back up to the calling function,
4) If (Result<>invalid And LEN(Result)>0) Then
display the search results
else
screen was closed with the back, cancel, or up button because the search term was 0 bytes in length
end if
Just a side note - no idea when this will happen but Roku did announce they are dropping support for these older generation 1 boxes - not going to allow new channels to be put into the channel store for them.
Thanks destruk for reply .
Actually i am doing same thing. problem is that - how to catch individual index. suppose
i got 4 suggestion by searchPhrase.Len() > 2 like:
delhi
2)mumbai
3)kolkata
4)chennai
how to catch index 1) delhi which is in array 0 position. i want to block up button here.
In given keyboard by roku there is space key when we press it it gives " " . i want to block it also as validation purpose .
Can you suggest for this.
i am doing :-
if msg.isPartialResult()
searchPhrase = msg.GetMessage()
if (searchPhrase=" ")
screen.SetSearchTerms(history)
screen.SetSearchTermHeaderText(searchHeaderText)
screen.SetClearButtonEnabled(false)
end if
end if
but what about when user press 2 or 3 or 4 …so on space before character . problem is that it count one character for space also when i do
Generally Prakesh, you don’t want to deal with leading or trailing spaces for search terms. You can use .trim() to remove the leading/trailing spaces.
If all you want is to prevent it from accepting a search term with a leading space from a past history listing, then you can check the left character with this –
if msg.GetMessage().left(1)=" "
or
if result.left(1)=" "
or
result=result.trim()
Depending on what variable line you’re working with.
Hi Komag,
Actually i am doing in Roku 2 and Roku 3 version 5.1 and 5.2 .> I just mean the cutoff date for supporting old “classic” Rokus has passed now, so we no longer have to worry about them.
I have also a legacy device 3.1 , is it passed now?
where I can find the complete details about cutoff date for supporting old Rokus?
If I understand what you are asking, you would probably have to check the search history terms themselves -
history = CreateObject(“roSearchHistory”)
list = history.GetAsArray()
print "There are “; list.Count(); " items in the history”
print list[0]
searchterm=list[0].trim()
if LEN(searchterm)>0 then return searchterm
If it’s automatically closing when you hit up on the search history list, then you should check the length of the search term and if it’s 0, or invalid, loop back to redraw the search screen again so they have to exit by selecting a cancel button or something, or just ignore the issue.