Question[Help]Boolean?[Solved]

Posts 115 of 20 · Page 1 of 2
[Help]Boolean?[Solved]
I know this might seem stupid, but since i haven't learned it ( i don't know why) i might as well ask it.

Could some one [Most likely NextGen] give me an definition of Strings, Integers and Booleans?
Boolean - True/False just like binary
Integer - Numeric value
String - Any text at all including numbers, letters, and special characters.
Thanks but i dont quite understand boolean. Can NextGen give me a more detailed explanation?
I'm sure NextGen can do better but:
The Boolean data type contains two-state values such as true/false, yes/no, or on/off.
For example, if you need to check whether a key is pressed or not you can declare a boolean variable. If the boolen variable is true, meaning the key has been pressed, it will do something. If not, it will do something else or nothing at all.
String: Any character in a sentence (no multi-lines)
Integer: A number without a decimal
Boolean: True / False
I think water is addicted to NextGen.

However, as they already stated, boolean is any 2 setting function, per se.
Has 2 options.
Quote Originally Posted by Mr. Lex View Post
I think water is addicted to NextGen.

However, as they already stated, boolean is any 2 setting function, per se.
Has 2 options.
No, its just that nextgen is much more experienced and can explain things in much more detail.
Yeah =D. /request close /solved
/Solved

Boolean is a Data Type

Boolean has Two State Values = True / False, It is used in the programming world as a "Flag"

Flags get triggered by a event and will either be On/Off

If not specified , by default Boolean is False , in otherwords off.

----------

VB.net allows us to convert numeric data type values to Boolean, which can be very handy in numerous situations

For example:
0 = False and all other values become True.

So for practicle reasons lets consider some Logic.

If the light is on then
it is bright
--------------
The light is on
Outcome = It is bright.

and that is the basic concept of boolean

So lets look at the above example in code format using the concept of a "Switch"

[php]
Dim Light As Boolean
If light = true Then
msgbox("It is Bright")
else
msgbox ("It is Dark")
End If
[/php]

You can set the "light" on and off (true or false) with

Light = True

or

Light = False

Hope This Helps
Yes thanks NextGen, but i don't understand the concept of declaring a boolean.
hmmm.. What don't you get about it

When you declare something as a boolean, essentially you are declaring it as the "switch" to check

[php]
dim Food as boolean = False
[/php]

Says that we have now created a switch called boolean which is in the off position

[php]
Dim Food as Boolean
[/php]

also says that we have now created a switch called Food which is in the odd position

[php]
Dim LightSwitch as Boolean
[/php]

By default the lightswitch is off

Button Click event

[php]
LightSwitch = True
[/php]

now the light switch is on

That's the most basic concept, I won't Even get into operators
Okay i sort of get it now. Could you give me some examples in which a boolean would actually be used in a real program?
dim a as boolean = true

timer1.tick
if a = false then
msgbox("Winner")
timer1.stop
else
'do nothing
end if
end sub

button1.click
a = false
end sub
So what exactly is "A" meant to do?
Posts 115 of 20 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?