Community

SCI Programming => Mega Tokyo SCI Archive => Topic started by: HMS on September 25, 2004, 03:22:38 PM

Title: Undefined Symbol "var"
Post by: HMS on September 25, 2004, 03:22:38 PM
Im sitting whidt this code from the tutorial:

(var button)
= button Print(
  "Do you want to click Yes or No?"
  #title "Click What?"
  #font LARGE_FONT
  #icon 0 0 0
  #button " Yes " 1
  #button " No " 0
)
(if(== button 1)
  Print("You clicked YES")
)(else
  Print("You clicked NO")
)

BUT it aint work!
It comes whitd followring errors:

Undefined Symbol "var"

why??

Title: Re:Undefined Symbol "var"
Post by: Doan Sephim on September 25, 2004, 03:42:51 PM
where did you put (var button)?
Title: Re:Undefined Symbol "var"
Post by: HMS on September 26, 2004, 04:33:31 AM
        (if(Said('look'))
            Print("You are in your beed room")
        )
     HERE
    )
)
Title: Re:Undefined Symbol "var"
Post by: Doan Sephim on September 26, 2004, 09:45:03 AM
yeah...thats the problem - define the variable like this:
(method (handleEvent pEvent)
        (var button)
then put the (if(Said('blah'))
                  = button Print("Blah")


Title: Re:Undefined Symbol "var"
Post by: HMS on September 26, 2004, 10:04:09 AM
THANKS
Title: Re:Undefined Symbol "var"
Post by: HMS on September 26, 2004, 10:09:57 AM
!!!

There is a new problem!!

Its come again and again how do i stop it?
Title: Re:Undefined Symbol "var"
Post by: Doan Sephim on September 26, 2004, 10:24:46 AM
i put this into a game and it didnt keep popping up: what code did you use and does it image what ive got here?
Code: [Select]
(method (handleEvent pEvent)
        (var dyingScript, button)
        (super:handleEvent(pEvent))
        (if(Said('eat/pig'))
            = button Print(
            "Do you want to click Yes or No?"
            #title "Click What?"
            #font LARGE_FONT
            #button " Yes " 1
            #button " No " 0
            )
            (if(== button 1)
                Print("You clicked YES")
            )(else
                Print("You clicked NO")
            )
        )
)
Title: Re:Undefined Symbol "var"
Post by: HMS on September 27, 2004, 08:14:10 AM
hmm i fixed the problem by going to another room.