Page 1 of 1

ViCalc

Posted: Thu Feb 10, 2022 10:16 am
by Niwains
Here is ViCalc from 1981 for the unexpanded VIC in tap and prg format.
I have also scanned the manual.

Re: ViCalc

Posted: Thu Feb 10, 2022 2:37 pm
by chysn
I have a long history of doing my taxes with a Tandy PC-3 pocket computer. This year, I might switch that up a bit.

ViCalc means "viable" calculator? That's interesting.

Re: ViCalc

Posted: Sat Feb 12, 2022 3:29 pm
by mathom
Thank you for this. I am always interested in the more utilitarian software for the VIC. I find it interesting to see how users and programmers of these early machines envisioned word processors, spreadsheets and the like before the paradigms became "standardized."

Re: ViCalc

Posted: Sat Feb 12, 2022 8:25 pm
by chysn
It functions much like an old Hewlett-Packard RPN calculator, but super-slow. I prefer this method of calculation over the more common algebraic system, and it was fun playing with this.

It's a couple hundred lines of BASIC, so obviously it could be faster.

Re: ViCalc

Posted: Wed Feb 16, 2022 2:00 am
by wimoos
I have looked into ViCalc. Its slowness is more due to the way the screen is handled (cursor movement), than to the length of the program (it is a little bit less than 100 lines).

Performance improvements could be done by changing 'IF <cond1> AND <cond2>' into 'IF <cond1> THEN IF <cond2>' constructs.
Also, the rounding function expression uses the power function twice or thrice, which makes it slow.
When setting the precision, it would be better to do this by precalculating the P%'th power of 10.

To me, this is a candidate to convert to WimBasic, that has (amongst others) the PRINT@ statement and the ROUND function.

Regards,

Wim.

Re: ViCalc

Posted: Fri Feb 25, 2022 11:20 am
by wimoos
I optimised ViCalc in WimBasic. It is now less than 70 lines and a little over 2k in size. I added an autoboot D64 in the zip file.
It still works conform the manual

I found some bugs that I fixed, and I used WimBasic features like ROUND, EVAL, INSTR, PRINT@ and SWAP. This makes it more responsive.

I also used ON ERROR GOTO for catching errors like ILLEGAL QUANTITY, OVERFLOW and DIVISION BY ZERO. The original version prevents these errors and then does nothing. The WimBasic version does not prevent but catches, and then an appropriate message is displayed.

Regards,

Wim.
ViCalc.zip
(622.43 KiB) Downloaded 102 times

Re: ViCalc

Posted: Fri Feb 25, 2022 3:18 pm
by orion70
Great job 👌. Thanks Niwains and Wimoos!

Re: ViCalc

Posted: Mon Feb 28, 2022 2:30 pm
by Niwains
Awesome work, wimoos!

Re: ViCalc

Posted: Sat Mar 26, 2022 5:59 am
by javierglez
wimoos wrote: ↑Fri Feb 25, 2022 11:20 am I optimised ViCalc in WimBasic.
Your webpage https://wimbasic.webs.com/ is referencing wimbasic.zip file with an https instead of http, and at first the link looks broken, at least when using Chrome browser.

Re: ViCalc

Posted: Mon Mar 28, 2022 1:03 pm
by wimoos
Fixed it, thanks for your remark. The prg was also included in the zipped autoboot disk in my previous post.
@moderator: Sorry for hijacking this subject.

Regards,

Wim.