getmode("0")→umode
©Set modes to Function plot, full screen, and Approx
setmode({"1","1","8","1","14","3"})
©Initialize settings if nonexistent
©The settings are saved as global variables, for defaults each time the program
©is executed. If igrand does not exist, the program assumes none of the
©parameters exist, and they are initialized to valid values.
©These global variables are created in the current folder, and are NOT deleted.
if gettype(igrand)="NONE" then
x→igrand ©integrand
0→lil ©lower integration limit
0→lpl ©lower plot limit
1→upl ©upper plot limit
1→res ©plot resolution
3→dpn ©data plot number
endif
©Main loop
lbl l1
©Convert parameters to strings for dialog box
string(igrand)→igrand
string(lil)→lil
string(lpl)→lpl
string(upl)→upl
string(res)→res
string(dpn)→dpn
©Prompt for all parameters
dialog
title "PLOT INTEGRAL"
request "Integrand f(x)",igrand
text "(or ""f(x)"")"
request "Low int limit",lil
request "Low plot limit",lpl
request "Upper plot limit",upl
request "Resolution",res
request "Data plot number",dpn
enddlog
©Convert parameters from strings to expressions
expr(igrand)→igrand
expr(lil)→lil
expr(lpl)→lpl
expr(upl)→upl
expr(res)→res
expr(dpn)→dpn
©Give user the chance to quit here
if ok=0:goto l2
©Validate parameters:
©lower plot limit must be less than upper plot limit,
©resolution must be an integer greater than zero,
©data plot number must be an integer from 1 to 99
©If parameter is invalid, display error message and return to input dialog box
©Validate upper & lower plot limits
if lpl≥upl then
dialog
4 - 13