Page 1 of 1

Winamp script Troubles :(

Posted: Sat Jan 18, 2003 5:45 pm
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.

Re: Winamp script Troubles :(

Posted: Sat Jan 18, 2003 9:33 pm
by hob_goblin

Code: Select all

echo "<p>Current Postion: ".GetPlaylistPosition()+1."<br>";
should work.

Posted: Sat Jan 18, 2003 10:40 pm
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.

Posted: Sat Jan 18, 2003 11:12 pm
by glo-wurm
try putting parentheses around the "GetPlaylistPosition()+1" in your echo line...

Code: Select all

echo "<p>Current Postion: ".(GetPlaylistPosition()+1)."<br>";

Posted: Sat Jan 18, 2003 11:51 pm
by craka
ahh.. thanks alot