Winamp script Troubles :(

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
craka
Forum Newbie
Posts: 21
Joined: Thu Jul 11, 2002 9:04 pm

Winamp script Troubles :(

Post by craka »

Ok, Im writing a script that displays information from a winamp client. it all works except for one thing. I want to display the current track number. It displays a number, but the number displayed is one less than the current number... when its playing track 345 it displays 344.. this may be easy to fix but i cant figure it out.. sometimes its the little things that screw you over...

in one file i have the function ..

Code: Select all

function GetPlaylistPosition()
{
  $res = httpQ("getlistpos", "");
  return $resїcount($res)-1];
}
then its called in another file..

Code: Select all

echo "<p>Current Postion: ".GetPlaylistPosition()."<br>";
anyone know how i can add 1 to this number?.. oh.. btw.. im a noob at php.. if you didnt alreay figure out.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Re: Winamp script Troubles :(

Post by hob_goblin »

Code: Select all

echo "<p>Current Postion: ".GetPlaylistPosition()+1."<br>";
should work.
craka
Forum Newbie
Posts: 21
Joined: Thu Jul 11, 2002 9:04 pm

Post by craka »

thanks for reply.. but..

then i get ..

Parse error: parse error, expecting `','' or `';''

i think ive tried that... which is why i posted cuz im puzzled.
glo-wurm
Forum Newbie
Posts: 13
Joined: Mon Jan 13, 2003 2:07 pm
Location: Naples, FL

Post by glo-wurm »

try putting parentheses around the "GetPlaylistPosition()+1" in your echo line...

Code: Select all

echo "<p>Current Postion: ".(GetPlaylistPosition()+1)."<br>";
craka
Forum Newbie
Posts: 21
Joined: Thu Jul 11, 2002 9:04 pm

Post by craka »

ahh.. thanks alot
Post Reply