order of addition and subtraction in fbcadcam-macro.bas

If you find a bug tell us so we can fix it.

Moderators: kitty_webb, Ywsp, joanCruz03, yajra1219, Jayem, shela

Post Reply
owen
Site Admin
Posts: 637
Joined: Thu Apr 13, 2017 12:14 pm

order of addition and subtraction in fbcadcam-macro.bas

Post by owen » Tue Nov 06, 2018 3:00 am

3-2+1=2
however fbcadcam-macro calculates it as
3-2+1=0

the reason for this is due to an order of opperations issue.

what it does is the addition first then the subtraction

so 2+1=3
then
3-3=0

until i can fix this the solution is to enclose the subtraction operation in parenthesis like this
(3 -2)+1

rexxitall
Posts: 8
Joined: Mon Mar 18, 2019 1:01 pm

Re: order of addition and subtraction in fbcadcam-macro.bas

Post by rexxitall » Wed Apr 10, 2019 8:06 pm

Hi Owen gives this beast a try
It can also handles variables.
http://freesourcecode.net/vbprojects/19 ... Parser.cls
works really great and know also () rules;)
You do not get worry by its class neme.
Works perfect also as normal code

Bet regards
Thomas

owen
Site Admin
Posts: 637
Joined: Thu Apr 13, 2017 12:14 pm

Re: order of addition and subtraction in fbcadcam-macro.bas

Post by owen » Sun Apr 14, 2019 9:47 am

thanks rexxitall i grabbed it (2777 LOC)

Post Reply