SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Non-Member bronze trophy geniusgoalie's Avatar
    Join Date
    Sep 2004
    Location
    Buffalo, USA
    Posts
    979
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    parse error makes no sense!

    Hello,
    I have been getting a parse error on this bit of code:

    PHP Code:
         $rgb ImageColorAt($image,$x,$y);//WORKS FINE
            
    $r = ($rgb >> 16) & 0xFF;//WORKS FINE
        
    $g = ($rgb >> 8) & 0xFF
        
    $b $rgb 0xFF;        

        
    $rgb1 ImageColorAt($image,$x2,$y);
            $
    2r = ($rgb1 >> 16) & 0xFF;//PARSE ERROR HERE
            
    $2g = ($rgb1 >> 8) & 0xFF
            $
    2b $rgb1 0xFF
    The error is:
    Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' on line 74
    I cannot figure out what the problem is, as the other almot identical coe before it works fine!

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    look at the php code in your post, the $ signs on the parse error line are green uggesting that something above it is wrong. It might be that you are using numbers in your definition ie $x2 try without the numbers $xb.....

    Just a suggestion!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    Non-Member bronze trophy geniusgoalie's Avatar
    Join Date
    Sep 2004
    Location
    Buffalo, USA
    Posts
    979
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, it worked!
    I didn't know that numbers couldn't be variables
    thanks a lot!

  4. #4
    Obey the Purebreed trib4lmaniac's Avatar
    Join Date
    Dec 2004
    Location
    Cornwall, UK
    Posts
    594
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Numbers can be used in variables, but not as the first letter.

  5. #5
    SitePoint Zealot
    Join Date
    Jan 2003
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by trib4lmaniac
    Numbers can be used in variables, but not as the first letter.
    That'd explain my problem then - thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •