SRL Archive - OSR Outdated Tutorials

[Q] Boolean flags


msemtex

2013-07-28 20:48:56

Hi, I want to know how to make use of boolean flags in simba. The flags are to be used to flag when the bank is successfully opened

e.g.

Java Example



bool boolFlag= false;

if(accessBank = true)
{
boolFlag = true;
}

if(boolFlag = true)
{
depositInven();
}


Flight

2013-07-28 21:08:18

Well you could go about this a couple of ways:

if aBoolean then
Writeln('A true boolean!')
else if not aBoolean then
Writeln('It is false...');

if (aBoolean = True) then
Writeln('A true boolean!')
else if (aBoolean = False) then
Writeln('It is false...');

If you'd like a little more info on the subject you can check out this post but I don't think it's very relevant to your question.

DrChill

2013-07-28 21:57:20

It should be called a boolean variable, or perhaps boolean value, but not flag. AFAIK flags are only when you call a program via a text command e.g.:
hackplanet.exe -target:world
-target:world would be considered the flag part of the command