A simple calculator. Uses a combination of Run Basic and JavaScript
Features:
C
Clear hold area
CE
Clear entry
Ceil
Round Up (Ceiling)
Floor
Round Down
/
Divide
*
Multiply
-
Subtract
+
Add
+/-
Change Sign
sqrt
Square Root
%
Divide by 100
1/X
Divide into 1
**
To the power of
sin
Sine of
log
Log of
cos
CoSign of
tan
Tangent of
=
Compute result

' ------------------------------------------------------
' Calculator
' ------------------------------------------------------
TITLEBAR "Calculator"
 
html " <script type='text/javascript'>
<!--
function number(key)
    {
    val = document.getElementById('value').innerHTML;
    val = val + key
    document.getElementById('value').innerHTML = val;
    }
//--></script> "
 
html " <script type='text/javascript'>
<!--
function funct(func)
    {
    val = document.getElementById('value').innerHTML;
    //alert('func:' + func + ' |val:' + val);
 
    if (func == '1x') {val = 1 / val;}
    if (func == 'C') {val = ''; }
    if (func == 'pm') {val = 0 - val;}
    if (func == '.') {val = val + '.';}
    if (func == 'sqrt') {val = Math.sqrt(val);}
    if (func == 'cel') {val = Math.round(val);}
    if (func == 'flr') {val = parseInt(val);}
    if (func == 'pcnt') {val = val / 100;}
    if (func == 'log') {val = Math.log(val);}
    if (func == 'sin') {val = Math.sin(val);}
    if (func == 'cos') {val = Math.cos(val);}
    if (func == 'tan') {val = Math.tan(val);}
 
    if (func == 'ce')
        {
        document.getElementById('opCode').innerHTML = '';
        document.getElementById('opData').innerHTML = '';
        }
 
    if (func == '/' || func == '+' || func == '-' || func == '*' || func == '**')
        {
        document.getElementById('opCode').innerHTML = func;
        document.getElementById('opData').innerHTML = val;
        val = '';
        }
    if (func == 'eq')
        {
        op = document.getElementById('opCode').innerHTML;
        data = document.getElementById('opData').innerHTML;
        if (op == '/') {val = data / val;}
        if (op == '+') {val = parseFloat(data) + parseFloat(val);}
        if (op == '-') {val = data - val;}
        if (op == '*') {val = data * val;}
        if (op == '**') {val = Math.pow(data,val);}
        document.getElementById('opCode').innerHTML = '';
        document.getElementById('opData').innerHTML = '';
        }
 
    document.getElementById('value').innerHTML = val;
}
//--></script> "
 
 
CSSClass "a.b", "{
    Width:25px; Height:25px; Text-Align:Center; Border-Width:3px; Border-Style:Outset;
    background:#BBBBBB; Border-Color:#AAAAAA; Font-Size:12pt; Font-Weight:Bold;
    Font-Family:Arial; Text-Decoration:None; Display:Block;
    }"
CSSClass "a.r", "{
    Width:35px; Height: 25px; Text-Align:Center; Border-Width:3px; Border-Style:Outset;
    background:#BBBBBB; Border-Color:#AAAAAA; Font-Size:12pt;Font-Weight:Bold;
    Font-Family:Arial; Text-Decoration:None; color:red;
    Display: Block;
    }"
 
html "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width=240><TR><TD>"
 
html "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 height=20 WIDTH=100%><TR style='font-family: arial; font-size: 1.2em; font-weight: bold;'>"
html "<TD id=opData ALIGN=RIGHT></TD>"
html "<TD id=opCode ALIGN=center></TD>"
html "</TR></TABLE>"
html "</TD></TR><TR>"
html "<TD id='value' height=40 align=right style='font-family: arial; font-size: 1.5em; font-weight: bold; color: blue;'>"
 
html "</TD></TR><TR><TD>"
html "<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=3 WIDTH=100% BGCOLOR=#BBBBBB>"
html "<TR align=center>"
html "<TD>"
    link     #ce, "CE", [func]
        #ce SETKEY("ce")
        #ce cssclass("r")
html "</TD><TD>" ' ceiling
    link     #cel, "Ceil", [func]
        #cel SETKEY("cel")
        #cel cssclass("r")
html "</TD><TD>" ' floor
    link     #flr, "Flor", [func]
        #flr SETKEY("flr")
        #flr cssclass("r")
html "</TD><TD>"
    link     #clr, "C", [func]
        #clr SETKEY("C")
        #clr cssclass("r")
html "</TD></TR></TABLE></TD></TR>"
html "<TR align=center>"
html "<TD BGCOLOR=white>"
html "<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=4 WIDTH=100% BGCOLOR=#BBBBBB>"
html "<TR align=center>"
html "<TD WIDTH=20%>"
    link     #7, "7", [num]
        #7 SETKEY(7)
        #7 cssclass("b")
html "</TD><TD WIDTH=20%>"
    link     #8, "8", [num]
        #8 SETKEY(8)
        #8 cssclass("b")
html "</TD><TD WIDTH=20%>"
    link     #9, "9", [num]
        #9 SETKEY(9)
        #9 cssclass("b")
html "</TD><TD WIDTH=20% >"
    link     #div, "/", [func]
        #div SETKEY("/")
        #div cssclass("r")
html "</TD><TD WIDTH=20%>"
    link     #sqrt, "sqrt", [func]
        #sqrt SETKEY("sqrt")
        #sqrt cssclass("r")
html "</TD></TR><TR align=center>"
 
html "<TD>"
    link     #4, "4", [num]
        #4 SETKEY(4)
        #4 cssclass("b")
html "</TD><TD>"
    link     #5, "5", [num]
        #5 SETKEY(5)
        #5 cssclass("b")
html "</TD><TD>"
    link     #6, "6", [num]
        #6 SETKEY(6)
        #6 cssclass("b")
html "</TD><TD>"
    link     #mult, "*", [func]
        #mult SETKEY("*")
        #mult cssclass("r")
html "</TD><TD>"
    link     #pcnt, "%", [func]
        #pcnt SETKEY("pcnt")
        #pcnt cssclass("r")
html "</TD></TR><TR align=center>"
html "<TD>"
    link     #1, "1", [num]
        #1 SETKEY(1)
        #1 cssclass("b")
html "</TD><TD>"
    link     #2, "2", [num]
        #2 SETKEY(2)
        #2 cssclass("b")
html "</TD><TD>"
    link     #3, "3", [num]
        #3 SETKEY(3)
        #3 cssclass("b")
html "</TD><TD>"
    link     #mins, "-", [func]
        #mins SETKEY("-")
        #mins cssclass("r")
html "</TD><TD>"
    link    #1x, "1/X", [func]
        #1x SETKEY("1x")
        #1x cssclass("r")
html "</TD></TR><TR align=center>"
html "<TD>"
    link     #0, "0", [num]
        #0 SETKEY(0)
        #0 cssclass("b")
html "</TD><TD>"
    link     #dot, ".", [func]
        #dot SETKEY(".")
        #dot cssclass("b")
html "</TD><TD>"
    link     #pm, "+/-", [func]
        #pm SETKEY("pm")
        #pm cssclass("r")
html "</TD><TD><B>"
    link     #pl, "+", [func]
        #pl SETKEY("+")
        #pl cssclass("r")
html "</TD><TD>"
    link     #eq, "=", [func]
        #eq SETKEY("eq")
        #eq cssclass("r")
html "</TD></TR></TABLE>"
html "<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=3 WIDTH=100% bgcolor=#BBBBBB>"
html "<TR align=center><TD>"
    link     #pow, "**", [func]
        #pow SETKEY("**")
        #pow cssclass("r")
 
html "</TD><TD>"
    link     #log, "log", [func]
        #log SETKEY("log")
        #log cssclass("r")
html "</TD><TD>"
    link     #sin, "sin", [func]
        #sin SETKEY("sin")
        #sin cssclass("r")
html "</TD><TD>"
    link     #cos, "cos", [func]
        #cos SETKEY("cos")
        #cos cssclass("r")
html "</TD><TD>"
    link     #tan, "tan", [func]
        #tan SETKEY("tan")
        #tan cssclass("r")
html "</TD></TR>"
html "</TABLE></TD></TR></TABLE>"
 
[num]
html "<script>number('";EventKey$;"')</script>"
wait
 
[func]
html "<script>funct('";EventKey$;"')</script>"
wait
END