Author |
Message |
ynotpeace
|
Posted: 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
|
|
|
TerranceN
|
Posted: 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
|
Posted: 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
|
Posted: Wed Feb 10, 2010 5:48 pm Post subject: RE:A "not" command in If Statements |
|
|
Turing also uses != in its language. |
|
|
|
|
|
TheGuardian001
|
Posted: 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
|
Posted: Wed Feb 10, 2010 9:25 pm Post subject: RE:A "not" command in If Statements |
|
|
Really? ~= is equal to not=? Interesting... |
|
|
|
|
|
SNIPERDUDE
|
Posted: 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. |
|
|
|
|
|
|