Velocity Reviews > Re: what is

# Re: what is

Fred Orton
Guest
Posts: n/a

 06-23-2003
Assuming you mean "use" a boolean. That is a yes-no or true-false variable.

For example, if you were testing if a number was negative, and wanted to
store the result, you would create a boolean variable, and set it to "true"
if the number was negative. You could then use that variable later on in a
program as a test -- ex: you may not want to perform a mathematical
operation if the input was a negative number.

Booleans are mostly used as flags - a condition is met, a variable is
negative or not, a customer has paid or not, etc...

Hope this helps,

Fred.

"matt" <(E-Mail Removed)> wrote in message
news:_uHJa.1945\$(E-Mail Removed)...
> where would i sue a boolean
>
>

Gram
Guest
Posts: n/a

 06-23-2003
It helps link into the rest of the computer science world if you think of it
as an equivalent of a bit i..e 0 = false and 1 = true. It's a great
alternative to data types such as integer which is atleast 8 bits

"Fred Orton" <(E-Mail Removed)> wrote in message
news:7EHJa.293973\$(E-Mail Removed) a...
> Assuming you mean "use" a boolean. That is a yes-no or true-false

variable.
>
> For example, if you were testing if a number was negative, and wanted to
> store the result, you would create a boolean variable, and set it to

"true"
> if the number was negative. You could then use that variable later on in

a
> program as a test -- ex: you may not want to perform a mathematical
> operation if the input was a negative number.
>
> Booleans are mostly used as flags - a condition is met, a variable is
> negative or not, a customer has paid or not, etc...
>
> Hope this helps,
>
> Fred.
>
> "matt" <(E-Mail Removed)> wrote in message
> news:_uHJa.1945\$(E-Mail Removed)...
> > where would i sue a boolean
> >
> >

>
>