5 Replies - 4149 Views - Last Post: 20 November 2008 - 06:52 PM Rate Topic: -----

#1 ShadowKyogre  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 11-November 08

Syntax Error

Post icon  Posted 19 November 2008 - 03:50 PM

Okay...I put this in:

print "Is 3 = 4 or 8 > 2?"
print (3 = 4 || 8 > 2)


When it gets to "print (3 = 4 || 8 > 2)", it says syntax error. How do I fix this?
Is This A Good Question/Topic? 0
  • +

Replies To: Syntax Error

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4359
  • View blog
  • Posts: 12,176
  • Joined: 18-April 07

Re: Syntax Error

Posted 19 November 2008 - 04:00 PM

Make it "3 == 4" and not "3 = 4". You are testing equality here, so you need the double equal signs. This is saying "is 3 equal to 4?" Obviously it is not, but since 8 is greater than 2, the whole thing is true. So the result is Is 3 = 4 or 8 > 2?true

:)

This post has been edited by Martyr2: 19 November 2008 - 04:01 PM

Was This Post Helpful? 0
  • +
  • -

#3 ShadowKyogre  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 11-November 08

Re: Syntax Error

Posted 19 November 2008 - 04:02 PM

Oh...whoops! ^^
Wait...even after I fixed that, it still gives me syntax error. As weird as this sounds, I'm using RPG Maker XP to test my Ruby... I don't know if it's RPGMXP or my language.

This post has been edited by ShadowKyogre: 19 November 2008 - 04:04 PM

Was This Post Helpful? 0
  • +
  • -

#4 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4359
  • View blog
  • Posts: 12,176
  • Joined: 18-April 07

Re: Syntax Error

Posted 19 November 2008 - 04:10 PM

Well it is the maker you are using because I know the fix to be correct and outputs exactly what I am showing you. Make sure that you have dumped any cached files it might be using and saving your change correctly. Sounds like you need a refresh somewhere.

:)
Was This Post Helpful? 0
  • +
  • -

#5 ShadowKyogre  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 11-November 08

Re: Syntax Error

Posted 19 November 2008 - 04:19 PM

Thinking...
Saving change correctly: Yes
Dump cached files: No....but how would I do that? I don't think I have any cached files since I haven't been saving my game each time I test a script.
Was This Post Helpful? 0
  • +
  • -

#6 ShadowKyogre  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 11-November 08

Re: Syntax Error

Posted 20 November 2008 - 06:52 PM

Okay, I fixed it. Apparently, I had to change ! to != when comparing two values...the tut I was looking at did not make that clear.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1