BOOL!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

BOOL!

Post by jgu1 »

Hi everybody! :D

Is there here anybody who can help me how to use BOOL, true or false in FC. Only a simple examble. I can´t find anything about this even not in the helpfile. :?:


Best Regard

jorgen.

User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

Re: BOOL!

Post by fotios »

Hi Jorgen
A very simple Boolean function that is executed by FlowCode is the "Decision". You know that in a FC Decision is checked if a concrette variable fulfils a condition, for example "If switch = 1?" Here the variable under test is the "switch". That is also a Boolean expresion: "Switch is TRUE?" The ON (=1) condition corresponds to TRUE, while the OFF (=0) condition corresponds to FALSE. Accordingly, there are two branches after a FlowCode Decision, the one that is called "yes" corresponds to Boolean TRUE while the other that called "no" corresponds to Boolean FALSE.
Fotis
Best Regards FOTIS ANAGNOSTOU

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: BOOL!

Post by jgu1 »

Hi Fotio!

Thank you for your help. :D

I understand the function of BOOL. It's more how to handle it in FC I think when you create the variable and handle it in an if function. I would be very happy if you could make a small example.

Thanks in advance.

regard

Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: BOOL!

Post by Benj »

Hello,

Using a bool in a decision should be straightforward.

If b1 is your boolean variable

To check if b1 is set you could enter the following into a decision icon

Code: Select all

b1
or

Code: Select all

b1 = 1
To check if b1 is clear you could do

Code: Select all

!b1
or

Code: Select all

b1 = 0

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: BOOL!

Post by jgu1 »

Hi Ben! :D

Thank´s for your help. I understand the meaning with BOOL, Maybe I am stupid, but I have some problems to handle it in FC. Please, would you be kind to change it in att. test FC. :?:

Thank´s in advance.

Best regard

JGU
Attachments
BOOL_Test.fcf
(8.5 KiB) Downloaded 221 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: BOOL!

Post by Benj »

Hello,

Here you go,
BOOL_Test-1.fcf
(8.5 KiB) Downloaded 248 times
Are you testing on hardware or in simulation?

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: BOOL!

Post by jgu1 »

Hi Ben! :D

Thank you, now I am in business. It´s a new kind of variable for me. At the moment I test it in simulation, but later in "real wold". I know I have config the Pic before downloading.

Once again, thank you.

Best regard

Jorgen.

Post Reply