Author |
|
mcable1004 Newbie
Joined: March 22 2007
Online Status: Offline Posts: 15
|
Posted: November 02 2008 at 20:57 | IP Logged
|
|
|
I have a .psp page that I use to send IR commands to my receiver. When I load the page I get the following error:
"An error occurred while retrieving data from the IR table."
Any idea how to resolve this or what to look for in the IR table? I suppose I could relearn all of the commands, but there are a bunch of them, so I'd rather not have to.
Thanks
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: November 03 2008 at 07:33 | IP Logged
|
|
|
It sounds like the problem may be your code and not the table. Can you post it?
|
Back to Top |
|
|
mcable1004 Newbie
Joined: March 22 2007
Online Status: Offline Posts: 15
|
Posted: November 03 2008 at 21:16 | IP Logged
|
|
|
Here's the code from my .psp page. You may be right Tony that it's a problem with my code. I'm still learning the ins and outs of the .psp pages, so it may be something pretty straightforward.
Thanks again!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Music - Garage </TITLE>
</HEAD>
<BODY>
<font face="verdana" size=2>
<% ph_rtne(ph_setvar_a( 1, 1, ph_getwebparm("recvr"))) %>
<% ph_rtne(ph_ir('SONYRCVR', ph_getvar_n(1, 1)))%>
<% ph_rtne(ph_setvar_a( 1, 2, ph_getwebparm("winamp"))) %>
<% ph_rtne(ph_winampctrl ( ph_getvar_s(1, 2), 0, "") )%>
<br>
<br>
<a href="/music_garage.psp?recvr=1&winamp=''">Tuner</a> ;
<a href="/music_garage.psp?recvr=2&winamp=''">MP3s</a>
<a href="/music_garage.psp?recvr=3&winamp=''">Vol +</a>
<a href="/music_garage.psp?recvr=4&winamp=''">Vol -</a>
<br>
<a href="/music_garage.psp?recvr=16&winamp=prev">Previous Track</a>
<a href="/music_garage.psp?recvr=16&winamp=next">Next Track</a>
<a href="/music_garage.psp?recvr=16&recvr=0&winamp=play">Pla y/Pause</a>
<a href="/music_garage.psp?recvr=16&winamp=stop">Stop</a& gt;
<a href="/music_garage.psp?recvr=16&winamp=launch">Launch< ;/a>
</BODY>
</HTML>
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: November 03 2008 at 22:41 | IP Logged
|
|
|
I'm seeing the same thing using ph_ir, but switching the code and passed parameters to ph_irdesc works fine. Maybe a bug?
Oh, I also added some code to handle the initial null value when calling the page without parameters.
Code:
<% ph_rtne( if( ph_getvar_s( 1, 1)="", 0, ph_irdesc('DIRECTIVO', ph_getvar_s(1, 1)))) %> |
|
|
Edited by TonyNo - November 03 2008 at 22:42
|
Back to Top |
|
|
mcable1004 Newbie
Joined: March 22 2007
Online Status: Offline Posts: 15
|
Posted: November 04 2008 at 08:47 | IP Logged
|
|
|
Yep, you're right - if I use ph_irdesc instead of ph_ir it works great. Since I can accomplish the same thing using this function, I'll just switch to using that.
Also, thanks for the extra tip on handling the initial null value. I figured there was a way to do that, but hadn't looked into it yet. I've been using PowerHome for a while now, and still finding new things to play with all the time
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: November 04 2008 at 11:12 | IP Logged
|
|
|
It all depends upon what type of data is stored in the webparm "recvr". If this data is intended to be numeric and the number of the IR command, then the original way should work. However, if it's working with ph_irdesc, Im thinking that the data in "recvr" is string based and is the description of the IR key. In this case, the ph_ir would definately fail since the string data (if it was anything but a number) would evaluate to a 0 when interpreted as a number (ph_getvar_n). Since the IR values start at 1 and increase sequentially, ph_ir("SONYRCVR",0) would return the error message you're gettting .
Hope this helps,
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: November 04 2008 at 12:12 | IP Logged
|
|
|
It failed even when the param was a number.
|
Back to Top |
|
|