1 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! Program: INT_DEMO_F_INPUT_AREA.INT ! System : INTOUCH DEMONSTRATION SYSTEM ! Author : Allen ! Date : May 15, 1991 ! Purpose: illustrate INPUT AREA facility. !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% row% = 6 col_1% = 5 col_2% = 30 col_3% = 60 reply$ = "1234.5678" do line input at 4, 1, & prompt "Number? ", & length 12, & default reply$ : reply$ if _back or _exit then exit do if not valid(reply$, "NUMBER") then message error : "Numeric entry expected" repeat do end if reply = val(reply$) clear area row%, col_1%, row% + 14, 80 print bold, at row% + 0, col_1% : "ABS"; print "("; reply$; ")"; print tab(col_2%); "absolute value"; print bold : tab(col_3%); abs(reply); print bold, at row% + 1, col_1% : "CEIL"; print "("; reply$; ")"; print tab(col_2%); "smallest integer >= X"; print bold : tab(col_3%); ceil(reply); print bold, at row% + 2, col_1% : "FP"; print "("; reply$; ")"; print tab(col_2%); "fractional part"; print bold : tab(col_3%); fp(reply); print bold, at row% + 3, col_1% : "INT"; print "("; reply$; ")"; print tab(col_2%); "largest real <= X"; print bold : tab(col_3%); int(reply); print bold, at row% + 4, col_1% : "INTEGER"; print "("; reply$; ")"; print tab(col_2%); "integer value"; print bold : tab(col_3%); integer(reply); print bold, at row% + 5, col_1% : "IP"; print "("; reply$; ")"; print tab(col_2%); "integer part"; print bold : tab(col_3%); ip(reply); print bold, at row% + 6, col_1% : "MAX"; print "("; reply$; ", 100)"; print tab(col_2%); "larger of two values"; print bold : tab(col_3%); max(reply, 100); print bold, at row% + 7, col_1% : "MIN"; print "("; reply$; ", 100)"; print tab(col_2%); "lesser of two values"; print bold : tab(col_3%); min(reply, 100); print bold, at row% + 8, col_1% : "MOD"; print "("; reply$; ", 5)"; print tab(col_2%); "remainder of X / Y"; print bold : tab(col_3%); mod(reply, 5); print bold, at row% + 9, col_1% : "REAL"; print "("; reply$; ")"; print tab(col_2%); "real value"; print bold : tab(col_3%); real(reply); print bold, at row% + 10, col_1% : "ROUND"; print "("; reply$; ", 2)"; print tab(col_2%); "round"; print bold : tab(col_3%); round(reply, 2); print bold, at row% + 11, col_1% : "SGN"; print "("; reply$; ")"; print tab(col_2%); "sign"; print bold : tab(col_3%); sgn(reply); print bold, at row% + 12, col_1% : "SQR"; print "("; reply$; ")"; print tab(col_2%); "square root"; when exception in print bold : tab(col_3%); sqr(reply); use print bold : "invalid operation" end when print bold, at row% + 13, col_1% : "STR$"; print "("; reply$; ")"; print tab(col_2%); "real to string"; print tab(col_3%); if sgn(reply) = 0 or sgn(reply) = 1 then print " "; print bold : str$(reply); print bold, at row% + 14, col_1% : "VAL"; print '("'; reply$; '")'; print tab(col_2%); "string to real"; print bold : tab(col_3%); val(reply$); loop end