RPN calculator

User projects written in or related to FreeBASIC.
srvaldez
Posts: 2007
Joined: Sep 25, 2005 21:54

RPN calculator

Postby srvaldez » Jul 26, 2018 22:01

here's a simple RPNcalculator, made with WinFBE.
it's not quite perfect, there's no keyboard input and that's beyond my ability to implement.
RPN Tutorial https://hansklav.home.xs4all.nl/rpn/

the stack size is 1000 but only the first 4 are displayed.
corrected some bugs and added the ability store values in variables A thru G
to store a value that's on the stack into A, press Quote then A then STO
to put the value stored in A onto the stack press A

added:
a single click on a value on the stack will copy that value to the clipboard
the Copy button or a double-click on the stack will copy all values to the clipboard
the Paste button pastes values in the clipboard to the stack

added:
updated the calculator to handle keyboard number and arithmetic operator entry, also the enter or return key act as the return button.
Image
Last edited by srvaldez on Jul 30, 2018 14:38, edited 2 times in total.
dafhi
Posts: 1238
Joined: Jun 04, 2005 9:51

Re: RPN calculator

Postby dafhi » Jul 27, 2018 11:20

the bas file is garbled?
dodicat
Posts: 5826
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: RPN calculator

Postby dodicat » Jul 27, 2018 12:13

Seems to have a utf8 bom attatched.
You'll need an ide like poseidon to open the .bas file.
Anyway I get
File not found, "WinFormsX\WinFormsX.bi"
It is not in my afx folder.
Must be in the WinFBE editor??

The .exe runs OK of course, after a discussion with Win 10 anti-virus.

In the meantime

Code: Select all


#include "crt.bi"
system_("calc")
sleep 

as a poor substitute.
srvaldez
Posts: 2007
Joined: Sep 25, 2005 21:54

Re: RPN calculator

Postby srvaldez » Jul 27, 2018 14:04

thank for testing, yes you need to compile with WinFBE or perhaps copy the contents of the WinFBE_Suite\FreeBASIC-1.06.0-win32[64]\inc folder to your FB distribution, have not tested this, so I suggest you make a backup of your inc folder, just in case.
the bas file has a UTF-16 BOM and it's likely that the files in the inc folder are also UTF-16 and so would only work with a Unicode able IDE
this project was an exercise to get familiar with the WinFBE Visual designer and perhaps inspire others to give it try.
PaulSquires
Posts: 746
Joined: Jul 14, 2005 23:41
Contact:

Re: RPN calculator

Postby PaulSquires » Jul 27, 2018 15:32

I WinFormsX includes are part of the WinFBE Suite download or can be downloaded separately from https://github.com/PaulSquires/WinFormsX
Those includes are regular ANSI files.

In a WinFBE project you can have ANSI, UTF-8, or UTF-16 encoded files *however* any visual designer created source code file in WinFBE will always be UTF-16.
srvaldez
Posts: 2007
Joined: Sep 25, 2005 21:54

Re: RPN calculator

Postby srvaldez » Jul 30, 2018 14:37

updated the calculator to handle keyboard number and arithmetic operator entry, also the enter or return key act as the return button.
this completes the calculator project, the calculator is actually usable :-)

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 0 guests