Page 2 of 2

Re: Fractions Caculator

Posted: Sunday 18th October 2020 1:09pm
by cogier
I have tried the new version but have run into a some issues.

1/. The menu items don't work. The code should be as below: -
Public Sub mnuFracCalc_Click()

  'Load fractions calculator
  'Workspace1.Add(FracCalc)
  Workspace1.ActiveWindow = FracCalc

End
2/. I tried 1/2 divided by 9/32. The program failed at FracCalc Line 426 (Sum = ValueToConvert). Sum is an Integer and ValToConvert is a String. The answer should be 1 & 7/9.
3/. I tried 1 divided by 8/16. The program failed at FracCalc Line 405 (FirstFrac = (WN1 + Numerator1 / Denominator1)) with a Divide by zero error. The answer should be 2.

Hope that helps.

Re: Fractions Caculator

Posted: Sunday 18th October 2020 11:11pm
by cage
Thanks Charlie for the input. I will look into fixing it. As for the menus I originally had them there to load the different parts of the program. I should of deleted them since the are all loaded at runtime.

Re: Fractions Caculator

Posted: Monday 19th October 2020 12:29am
by cage
Found the problem but it was in a different location. Now 1/2 / 9/32=1 25/32 instead of 1 7/9. This because 7/9 is not a measurement in construction calculations, meaning the smallest number in in 64s. Now 1 / 8/16=2 as you said. I remove the unnecessary items from the menu. The updated version is in the first post. I am always happy Charlie when you give your input. I am a retired cabinet designer and builder and use this program in my design work. Since there are no cabinet programs in Linux I now have to do the design work mostly by hand. The errors are a result of staying up way to late to complete a project, so I end up over looking things. :oops:

Re: Fractions Caculator

Posted: Tuesday 20th October 2020 3:08pm
by cogier
Hi cage,

Your program seems to work as expected now. I took the liberty of remaking the 'ConvChart' complete with a search.

Hope it is of use.
HandymanCalc-0.1.tar.gz
(17.65 KiB) Downloaded 327 times

Re: Fractions Caculator

Posted: Tuesday 20th October 2020 6:11pm
by cage
Thanks Charlie, that actually makes the program perfect. Don't know why I didn't think of that :oops:

Re: Fractions Caculator

Posted: Wednesday 21st October 2020 2:08am
by PJBlack
manjaro xfce and gambas 3.15.90:

1/2 + 1/2 -> Type mismatch: wanted float got string instead : 2 + 3/3=3 is correct

pushing 9 left field -> 1

123456789 X 9=98765424 (never ever) galculator gives me 1111111101

so IF that thing IS calculating i need a second calculator to proof the result ... nice

Re: Fractions Caculator

Posted: Wednesday 21st October 2020 3:24am
by cage
1/2 + 1/2 -> Type mismatch: wanted float got string instead : 2 + 3/3=3 is correct

pushing 9 left field -> 1

123456789 X 9=98765424 (never ever) galculator gives me 1111111101

so IF that thing IS calculating i need a second calculator to proof the result ... nice
Sorry to say I can not duplicate your problem with 1/2+1/2 as it comes out as 1 in Arch Linux. This program was never meant to be use as a standard calculator although it can for normal usage. Taking something like 123456789 X 9 is just a Lucretius example to prove that the calculator is no good. If galculator serves you well then you have no need for this program, then don't use it. Others may find it useful and use it. How ever I did find one small overlooked problem and fixed it. By the way 3/3 is not a normal fraction used in construction. Construction fractions are based in 64ths. Look at the conversion chart and you will see what I mean. Personally I don't mind people finding things amiss with the program, but constructively. Besides I only meant that Charlies mod to my program made the conversion chart perfect and not the whole program. The fix will be in the first post for those who want it.

Re: Fractions Caculator

Posted: Wednesday 21st October 2020 5:07pm
by cogier
I tried ½ + ½ and got 1 as well.

Image

Re: Fractions Caculator

Posted: Friday 23rd October 2020 5:58pm
by cage
On my version of Gambas which is 3.15.2 latest stable version, I tried 123456789 X 9 and I got the same answer as his calculator program.