
-----------------------------------
ynotpeace
Tue Feb 09, 2010 6:07 pm

A &quot;not&quot; 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

-----------------------------------
TerranceN
Tue Feb 09, 2010 6:27 pm

RE:A &quot;not&quot; command in If Statements
-----------------------------------
There are two ways to do this:

var x : int := 5

if x not= 10 then
    put "a"
end if

if not (x = 10) then
    put "b"
end if

-----------------------------------
Insectoid
Tue Feb 09, 2010 8:04 pm

RE:A &quot;not&quot; 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
Wed Feb 10, 2010 5:48 pm

RE:A &quot;not&quot; command in If Statements
-----------------------------------
Turing also uses != in its language.

-----------------------------------
TheGuardian001
Wed Feb 10, 2010 6:12 pm

Re: A &quot;not&quot; command in If Statements
-----------------------------------
No it doesn't. Trying to run code with a != results in an invalid character error.

-----------------------------------
USEC_OFFICER
Wed Feb 10, 2010 9:25 pm

RE:A &quot;not&quot; command in If Statements
-----------------------------------
Really? ~= is equal to not=? Interesting...

-----------------------------------
SNIPERDUDE
Wed Feb 10, 2010 11:33 pm

RE:A &quot;not&quot; command in If Statements
-----------------------------------
Yup.  Consider it a shortcut, like procedure can be typed as proc, function as fcn, etc.
