RUN BASIC CODE

Run Basic is a new and easy way to add active content to a web site.  Below is the code used for the simple calculators.  Visit the Run Basic web site to learn more.  
Pythagorean Theorem
 CSSID #Section1, "{Color: Lime;}"

answer$ = "?"

[display]
cls
DIV Section1
print "Pythagorean theorem"
END DIV
DIV Section1
textbox #first, first
print " LEG #1";
END DIV
print
DIV Section1
textbox #second, second
print " LEG #2";
END DIV
print
DIV Section1
print " Hypotenuse = "; answer$
END DIV
link #add, "CALC", [calc]
wait

[calc]
gosub [getFields]
answer$ = str$(SQR((first*first)+(second*second)))
goto [display]

[getFields]
first = #first value()
second = #second value()
return

END