dynamitemedia
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2010
04:03 PM
if msg.isButtonPressed() error
I keep getting this error
sometimes it will still load with it sometimes it wont
255: screen.Show()
256: while true
257: msg = wait(0, screen.GetMessagePort())
258: if msg.isButtonPressed()
259: ' print "Evt: msg.GetMessage();" idx:"; msg.GetIndex()
260:
261: if msg.GetIndex() = 1
262: exit while
263: endif
264: if msg.GetIndex() = 2
/tmp/plugin/FPAAAA997H4h/pkg:/source/appMain.brs(258): runtime error ec: 'Dot' Operator attempted with invalid BrightScript Component or interface reference.
258: if msg.isButtonPressed()
sometimes it will still load with it sometimes it wont
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
4 REPLIES 4
kbenson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2010
05:22 PM
Re: if msg.isButtonPressed() error
Sounds like you are getting invalid instead of an actual message, which was covered somewhat in http://forums.roku.com/viewtopic.php?f=34&t=31487. The simple solution is to throw another check that a valid event message was received (msg <> invalid).
-- GandK Labs
Check out Reversi! in the channel store!
Check out Reversi! in the channel store!
FML2010
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2010
05:50 PM
Re: if msg.isButtonPressed() error
is because there is no "then" in there?
ive had issues with them placed in the wrong spot
or should the "then " be with the elseif msg.isButtonPressed() ?
ive had issues with them placed in the wrong spot
msg = wait(0, screen.GetMessagePort())
if msg.isScreenClosed() then
print "Screen closed"
exit while
else if msg.isButtonPressed()
or should the "then " be with the elseif msg.isButtonPressed() ?
kbenson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2010
11:43 PM
Re: if msg.isButtonPressed() error
The "then" of an if statement is optional, so that has no bearing. I was referring to the msg variable holding an invalid values, so something like this may be required:
msg = wait(0, screen.GetMessagePort())
if msg<>invalid then
if msg.isScreenClosed() then
print "Screen closed"
exit while
else if msg.isButtonPressed()
... do something ...
end if
end if
-- GandK Labs
Check out Reversi! in the channel store!
Check out Reversi! in the channel store!
RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2010
11:54 AM
Re: if msg.isButtonPressed() error
We have an open bug we can easily reproduce by hitting the Home button on a script that causes a wait() with a timeout of zero to return an invalid message. We consider this a bug on our part and will fix it.
Do you have another scenario that causes invalid to be returned from a wait() with a timeout of zero??
--Kevin
Do you have another scenario that causes invalid to be returned from a wait() with a timeout of zero??
--Kevin