Hi guys.
i wanted to ask is it possible to to sth like at php
SCAR Code:
if($pos==true){
echo "true";
}elseif($pos==False){
echo "false";
}elseif(!isset($pos)){
echo "pos is not set";
}
Simba Code:
if FindSymbol(x, y, 'water') then
if FindSymbol(x, y, 'quest') then
if FindSymbol(x, y, 'shop') then
begin
WriteLn(' true');
end else
begin
WriteLn(' false');
end;
//how do o do "else if" or sth similar?
Edit: Silly my. probably something like that? or here is any option to do else if sentence?
Simba Code:
if FindSymbol(x, y, 'water') then
if FindSymbol(x, y, 'quest') then
if FindSymbol(x, y, 'shop') then
begin
WriteLn(' true');
end else
begin
if not FindSymbol(x, y, 'water') then
if not FindSymbol(x, y, 'quest') then
if not FindSymbol(x, y, 'shop') then
begin
WriteLn('false');
end else
begin
WriteLn('third option');
end;
end;
//sth like this? or here is something not so deep as in php?
---------------------------------------------
Another Question:
how can I create function / procedure which returns me true or false value.
i imagine something like this. but not sure or it's ok
Simba Code:
Procedure returnTrueOrFalse;
begin
if FindSymbol(x, y, 'tree') then
begin
return true;
end else
begin
return false;
end;
end;
Procedure checkWhatIsReturned;
begin
if returnTrueOrFalse then
begin
WriteLn('Returned True');
end else
WriteLN('Returned False');
end;
end;