Register

Grocery Accounting program

Topics on released projects. Only the author of a program should start a topic on it.
Junior Member
Posts: 17
Joined: Fri Aug 28, 2015 5:10 am
Calculators: Casio fx-9750G PLUS, Casio fx-9750 G II (SH4)

Grocery Accounting program

Postby brickviking » Thu Sep 17, 2015 11:41 am

First, the warning. Please make sure that List 5 and List 6 in File6 are free to be used, otherwise edit the GRCGET, GRCPUT, GRCSAVE and GRCLOAD routines to use Lists that are free. GRCSAVE/LOAD saves grocery vars, GRCPUT/GET saves all variables on entry, and restores them at exit of the program. This program also uses PICT6.

Of course this program has had some improvements. As of version 0.67, the program run speed has been significantly improved by caching non-volatile text to PICT6 and recalling it each time I draw the main screen, but the screen redraw rate is still fairly slow on a G+. The grocery program works quite satisfactorily on a fx-9750GII/9860GII. The only reason I used Lists 5 and 6 is because the G+ doesn't have any more lists than this, so I just used the last two lists I could. You can alter this to use List 25/26 on a GII. In addition, at least one of the routines is only actually used once, so could be inlined. I leave that as an exercise for you, the reader.

0.60 (not available for download): Recently I added some functionality to automatically back up all vars A-Z, r and Theta to a List so the variables can be "clobbered" by my grocery program. After the program finishes, I then restore those same variables. I also have the option of saving the existing grocery variables to another List, so that if you want to load them back in another time, you can.

0.61: Some slight refinements in the code for GRCAMAIN, as I realised I didn't need a couple of variable increments and all the comment/blank lines, that's reduced the bytecount a little.

0.65: Significantly sped up the program by saving the non-volatile text as a graphic to PICT6. This functionality is in GRCBTN, so run this first, or uncomment Prog "GRCBTN" near the top of GRCAMAIN for the first run. You can re-comment it once the picture has been initialised. PICT6 should be free for use.

0.66: Removed some code as it wasn't needed. I may have even sped the program up microscopically.

0.67: Apparently there's a SSe command embedded in a text string, which threw me out as it's not in a fx9750G+. A word was replaced, and RclPict was replaced with BG-Pict.

0.68: Added Tax support, initially set to 15%. Tweaked main screen.
0.69: Tweaked main screen further
0.70: Reworked Tax input screen
0.71: program now asks if you wish to save the current grocery values on exit.
0.72: program now asks if you wish to load previous grocery values on startup. I use this if I've been to another supermarket on the same day and want a grand total.

Now the warnings are out of the way, I can describe the rest of the program. I've had this grocery program in operation since I first got my fx9750G+ in 2008, and it's worked (mostly) very well since then.

The first thing you'll be presented with is the main screen, listing category totals and temp variables. The bottom line contains softkeys (F1 - F6) for grocery categories; Vege, Meat, etc. Each key prompts for a cost, except for Vege, which first prompts you for a weight or count (Vege Item #), then a cost per kg or cost per item. The rest (Meat, Clean, etc), should be easy enough to understand. Exit (on the keyboard) does the obvious, but asks if you wish to save the current grocery values into a List for reuse next time.

-> contains a set of temporary values so you can save prices-per-KG and recall them for later use with Vege input. i.e. if Oranges are $4.99 per kg, I hit ->, the program asks me for the first temporary var (P) figure. I enter in 4.99. When I get to the scales to weigh my oranges, let's say they're 1.3kg. I put in 1.3 for the item count, and P for a cost. Grapes (another example) are $5.99 per kg (which I then put into Q), and I got 550g of them. I put in 0.55 for Item #, and Q for the cost per kg. There are five temp variables you can use.

=> (F6) contains a function screen. Exit (on the keyboard) does the obvious, and Back returns to the main screen. Tax sets the rate to what you wish. Clear clears the grocery variables, Store/Load: save or restore the grocery variables to List 5 in File 6. List 6/File 6 contains the previously saved variables A~Z,r,Theta.

I hope this is useful to someone else. Do let me know what you think, or what refinements I could make. No bashing though.

Link to download

(Post 9)
Last edited by brickviking on Sat Dec 03, 2016 8:08 am, edited 7 times in total.
Regards, BrickViking

Junior Member
Posts: 17
Joined: Fri Aug 28, 2015 5:10 am
Calculators: Casio fx-9750G PLUS, Casio fx-9750 G II (SH4)

Re: Grocery Accounting program

Postby brickviking » Wed Sep 23, 2015 11:16 am

I've found one small bug, with no real way to work around it. If File6->List 5 happens to be empty (no values), and I try retrieving any information about that list (Dim List 5), I get Dimension Error on the fx-9860GII (or simply Dim Error on the fx-9750G+).

Unfortunately, this is rather a show stopper for the program. The only way around it I can think of is to store 13 zero elements into List 5 in GRCBTN, but this won't help if there are already 13 elements there. I don't want to force a creation of list values if they're already there, but I can't test for a non-present list without running into the aforementioned Dimension Error.

(Post 11)
Regards, BrickViking

Return to Released Projects

Who is online

Users browsing this forum: No registered users and 1 guest