  			pcalc usage examples

a. To avoid shell expansion include scripts in quotes. 

shell prompt# pcalc 'DEC=1 (12 + 3) * 3 echo ""'
45

b. Script that writes a header file, incrementing version/build number
with every compilation. use: pcalc @script > build.h

--------- cut here ------------

DEC = 1

echo "/*"
echo " * Build version number header generated by pcalc"
date " * Build date %d/%m/%y %H:%M:%S\n"
echo " */"
echo ""

date "#define BUILDDATE \"%d/%m/%y %H:%M:%S\"\n"

RESTORE aa
_echo "#define VERSION " aa
aa = aa + 1
STORE aa

echo ""

-------------- cut here ---------------

It outputs a 'C' file, but with small modification it can do most any language.

c. Add the shopping list items on the command line:

shell# pcalc \
10 * 12 + \     
12 * 9.99 + \
322+ 35

Have fun.
