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

Username:   Password: 
 RegisterRegister   
 A "not" command in If Statements
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ynotpeace




PostPosted: Tue Feb 09, 2010 6:07 pm   Post subject: A "not" command in If Statements

What is it you are trying to achieve?


I'm not too familiar with turing so I'm asking:
is there a "not" command for if statements?
for example:
if X "doesn't equal" Y Then

end if

Thanks for your help
Sponsor
Sponsor
Sponsor
sponsor
TerranceN




PostPosted: Tue Feb 09, 2010 6:27 pm   Post subject: RE:A "not" command in If Statements

There are two ways to do this:

Turing:
var x : int := 5

if x not= 10 then
    put "a"
end if

if not (x = 10) then
    put "b"
end if
Insectoid




PostPosted: Tue Feb 09, 2010 8:04 pm   Post subject: RE:A "not" command in If Statements

Turing also accepts the sqiggle (~) as 'not'

if this ~= that


Most languages use ! as not, Turing just likes to be different.
ProgrammingFun




PostPosted: Wed Feb 10, 2010 5:48 pm   Post subject: RE:A "not" command in If Statements

Turing also uses != in its language.
TheGuardian001




PostPosted: Wed Feb 10, 2010 6:12 pm   Post subject: Re: A "not" command in If Statements

No it doesn't. Trying to run code with a != results in an invalid character error.
USEC_OFFICER




PostPosted: Wed Feb 10, 2010 9:25 pm   Post subject: RE:A "not" command in If Statements

Really? ~= is equal to not=? Interesting...
SNIPERDUDE




PostPosted: Wed Feb 10, 2010 11:33 pm   Post subject: RE:A "not" command in If Statements

Yup. Consider it a shortcut, like procedure can be typed as proc, function as fcn, etc.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: