Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: IR Table Error Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
mcable1004
Newbie
Newbie
Avatar

Joined: March 22 2007
Online Status: Offline
Posts: 15
Posted: November 02 2008 at 20:57 | IP Logged Quote mcable1004

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 View mcable1004's Profile Search for other posts by mcable1004
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 03 2008 at 07:33 | IP Logged Quote TonyNo

It sounds like the problem may be your code and not the table. Can you post it?
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
mcable1004
Newbie
Newbie
Avatar

Joined: March 22 2007
Online Status: Offline
Posts: 15
Posted: November 03 2008 at 21:16 | IP Logged Quote mcable1004

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 View mcable1004's Profile Search for other posts by mcable1004
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 03 2008 at 22:41 | IP Logged Quote TonyNo

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 View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
mcable1004
Newbie
Newbie
Avatar

Joined: March 22 2007
Online Status: Offline
Posts: 15
Posted: November 04 2008 at 08:47 | IP Logged Quote mcable1004

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 View mcable1004's Profile Search for other posts by mcable1004
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 04 2008 at 11:12 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 04 2008 at 12:12 | IP Logged Quote TonyNo

It failed even when the param was a number.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum