The CALCIT command file provides the user with an interactive calculator. The user is prompted for an equation to be solved or an MPE/iX command to execute. To exit CALCIT, the user enters a carriage return.
Note that the CENTER command file is called to center the display headings on the user's terminal. After an equation is solved, the result is displayed on the terminal using escape sequences to append the result to the original input line and to underline it. The predefined variable HPMSGFENCE is used to suppress error messages.
The CALCIT prompt is based on the command file name. By dereferencing the latest command entered in the history stack (!-1), the name that called this command file becomes a part of the prompt. If the command file name is changed to COMPUTE, for example, the prompt automatically becomes COMPUTE ==>.
The following example shows the terminal display to calculate the equation 5 + 7.
:CALCIT
MPE/iX INTERACTIVE CALCULATOR
: executes any MPE/iX command
Type [RETURN] to exit
CALCIT ==> 5+7 = 12
CALCIT ==>
:
|