PDA

View Full Version : if or/and



mitchell li
08-19-2014, 03:18 PM
How do you code if statements in simba to have and/or?
Is it similar to these?
if (a = b && c = d) then
if (a = b || c = d) then
Also what is the code for not equal?
Is it similar to this?
:=!

KeepBotting
08-19-2014, 03:32 PM
if x = 6 and y = 9 then
doThis;

if x = 42 or y = 0 then
doThis;

if not i = 1 then
doThis;

Olly
08-19-2014, 07:07 PM
not equal = <>

rj
08-19-2014, 07:20 PM
2 different ways of doing not:

function bankOpen:boolean;
begin
result := false;
end;

begin
if (bankOpen <> true) then
writeln('hi');
end.


function bankOpen:boolean;
begin
result := false;
end;

begin
if (not bankOpen) then
writeln('hi');
end.