Calculator

Share your scripts written for the Script Device in this forum.
Post Reply
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Calculator

Post by Richard Naninck »

Just wrote a simple calculator script + panel.
It works.
The hbx file contains the panel, script, script device and null device.

Have fun.

Updated 5 August 2007
Attachments
Calculator.zip
(1.2 KiB) Downloaded 2167 times
Calculator.JPG
Calculator.JPG (17.97 KiB) Viewed 24610 times
Calculator.hbx
(44.6 KiB) Downloaded 2172 times
Last edited by Richard Naninck on Sun Sep 23, 2007 4:25 pm, edited 5 times in total.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Geez. HouseBot can do anything :wink:

Nice one Richard. Thanks.
Scott
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Just updated the first post with the latest version. This one has memory functions (M+, MR, MC) just like the standard windows calculator. Changed the image as well as the hbx file. Not sure what the windows MS button stands for, so I left it out.
If this product (plugin) is of interest to anybody and they want to have more functions like 1/x, %, sqrt etc please let me know and maybe I will add those too. It's just that I usually don't use these functions so I left them out.
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

MS is "Memory Store". This saves the current value to memory overwriting any value currently stored in the memory. M+ is "Memory Plus" (think of it as "Memory Add"). It takes the current value and *adds* it to the current contents of the memory. Nice job by the way!

-- Dave
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Aha, that figures and it makes so much sense that I will have to add it.
I always use M+, but I always start from 0. While Starting from 0, M+ and MS do the same thing.

Yesterday I found three small bugs.
- Couldn't enter 0.x and now that is fixed, but not uploaded yet. Will do so with the next version containing MS.
- Couldn't do Value + Memory whereas Memory + Value was possible. The next version both are possible.
- After storing a value in Memory and then entering a (new) digit, the digit was added in the display whereas it should start from zero again. Also fixed.

Also added Clear^Exit for the Panels Exit List. This clears the buffer and the Memory after Panel Exit so the next start will always be clean.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

First post is updated again.
Three bugfixes (see previous post) and MS functionality added and M+ functionality corrected.
incoronado
Senior Member
Posts: 153
Joined: Fri Mar 19, 2004 12:30 am
Location: San Diego, CA

Post by incoronado »

Great Ultility.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Thanks. It's actually looking at bit different already again. If you ever get to it, please post your metal (good and better than mine) looking graphics here.
Daan
Member
Posts: 1
Joined: Thu Jul 26, 2007 2:38 pm

Post by Daan »

Have you tried entering .25 times 3? You get 750 as a result. Same for 0.25 devided by three, you get some strange results.

Anyway, cool plugin! Thanks!
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Well, not in mine so I must have fixed that already and didn't upload it.
I will update post 1 to get it fixed.
incoronado
Senior Member
Posts: 153
Joined: Fri Mar 19, 2004 12:30 am
Location: San Diego, CA

Post by incoronado »

I have packaged Richard's awesome Calculator with an additional theme.
Attachments
Calculator.hbx
(151.52 KiB) Downloaded 2176 times
calculator.jpg
calculator.jpg (45.92 KiB) Viewed 24595 times
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Wow, I wish I could create stuff like that. Awesome and thanks! I will use this one in stead of my own.
Steve Horn
HouseBot Guru
Posts: 757
Joined: Wed Apr 02, 2003 8:10 pm
Location: Pelham AL

Post by Steve Horn »

A suggestion for your calculator script: On many calculators, entry of a number, the times (X) sign, then =, squares the number. That is: 5X= yields 25. On yours, it yields 0, since there is no 2nd number. Also, a percent function would be nice. Just a thought I had using it the other day...
FWIW,
Steve
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

I tried a simple hack to get the X = square in, but it wasn't so easy because the function messed with other calculations. I will look into this next week orso. As for the %, I never understood it's functionality so unless I get that straight, it probably won't make it in. Luckily this is all opensource so everybody is free to make their own adjustsments.
1/x and sqrt actually do make sense.
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Updated first post and added calculator.zip. Just copy it over the old script and all should work without any other changes.

It contains an updated script where 5 x = 25 and 6 + = 12 etc.

Still not sure about the %

1/x and sqr will be added later since it requires a panel update as well.
Post Reply