Math with Variable

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Math with Variable

Post by JLeith »

Hello All
Getting stumped on the symbol for being able to have two variables take the same decision route

I have a Variable called ( HM ) and another called ( VM ) and I can't figure how to have them both take the route.

I could have HM at 25 and then get VM at 25 a little later and the message is the same for both.

Would save the coding with combined

Here is a snap shot drawing

John
Attachments
HM or VM.png
(30.6 KiB) Downloaded 2618 times

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Math with Variable

Post by mnf »

Create a new macro that takes the switch variable as an argument.

Then call new_macro (VM) and new_macro (HM)

Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Math with Variable

Post by JLeith »

Thank you Martin

I have my program working with the 2 routes I was thinking if there was a ( "OR" ) logic in flowcode
Making it use either of the Variables for 1 route.

All the best
John

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Math with Variable

Post by medelec35 »

Hi John,
What about just adding another variable?
HM OR VM.png
(4.6 KiB) Downloaded 2590 times
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Math with Variable

Post by JLeith »

Excellent info Martin

So the HM | VM is a "OR" statement

Off to give it a go

John

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Math with Variable

Post by medelec35 »

JLeith wrote:Excellent info Martin
Not a problem, hopefully it's waht you are after?
JLeith wrote:So the HM | VM is a "OR" statement
Yes it it is.
When changing bits:
Bitwise Operators.png
(69.89 KiB) Downloaded 2569 times
Above is from tutorialspoint
If using a logical then use two lots instead of one.
e.g &&, || etc.

Let us know if it works or not?
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Math with Variable

Post by JLeith »

Hi Martin
I did the HM | VM and set Variable

Ran into a glitch.... Had to go back to HM and VM
If I came into HM with say 25 and have a code to stop playing the MP3 if the HM says at 25 and the VM goes up.

The hitch came wen HM was at 25 and the VM reached 25 the MP3 file would play due to stop code for HM affect the VM state.

It did work if HM and VM detection.

John

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Math with Variable

Post by medelec35 »

If it fails on one condition then the code within decision branch can be altered to deal with that condition.
So long as you know what you want to happen should that condition occur.
Martin

Post Reply