Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Problems with if statements
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
suckywinner123




PostPosted: Tue Jan 15, 2013 7:57 pm   Post subject: Problems with if statements

Heyy, I am having some problems with making if statements work

Turing:

loop
    mousewhere (x, y, button)
    if button = 1 and x >= 1005 and x <= 1099 and y >= 0 and y <= 35 then

        if indicate := 3 then
            proc3
        elsif indicate := 2 then
            proc2
        elsif indicate := 1 then
            proc1
        end if


        exit
    end if
end loop




So basically, after one "if statement" i want the computer to immdeiatley make another "if statement" which only happens if the first "if statement" happens (if they clicked on that spot)
I want it so that if they click on that specific spot, depending on what the value of the "indicate" variable (which the user decides on if it's 3,2, or 1 earlier in the program) is, it takes them to different places, but it wont allow me, saying "if" must be boolean type, i am not very good at Turing, so any help would really be appreciated. Thanks Smile
Sponsor
Sponsor
Sponsor
sponsor
tristanbryce7




PostPosted: Tue Jan 15, 2013 8:04 pm   Post subject: Re: Problems with if statements

You're not supposed to use ":=" for comparison statements , only "=" or "<= or >=" Razz so just change you statement from
indicate := 3
to
indicate = 3
Insectoid




PostPosted: Tue Jan 15, 2013 8:05 pm   Post subject: RE:Problems with if statements

code:
if indicate := 3 then


You sure you want to be using ':=' there?
suckywinner123




PostPosted: Tue Jan 15, 2013 8:08 pm   Post subject: Re: Problems with if statements

OHHHH, gosh, I can't believe I overlooked that haha :/ . Thanks so much !
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: