| MATHX.HLP FILE Copyright 1989 By David W. Denker | title= HELP INFORMATION wlcc b0f14l0:goto10 #10 HEAD B0F13" Select by the FIRST LETTER or use MOUSE or  CURSOR keys." x=10:i=0:j=0:WIND wr(x)wc30r5c24b14BB1BF15" MAIN HELP MENU Answer system Data input Error messages Functions (math) Instruction line Manual calculations Priority of calculations Quit help" #13:mon2:call60:if r=4}q:if r=5}c18 on(j)g{350,400,500,150,80,450,100,20} tone50:go13 #18:j=data k{1,0,0,2,3,4,0,0,5,0,0,0,6,0,0,7,8,0,0,0,0,0,0,0,0,0}:ret #20 QUIT #26:head" END help, PAGE UP, else help menu":ret #27:head" END help, HOME to help menu, PAGE UP, else continue":ret #28:head" END help, HOME to help menu, else continue":ret #29:head" END help, else main help menu":ret #36:call60:if r=4}q:if r=6}q:if r<>1}r if i>9999}}if i<10012}q:if i>10011}}if i<10021}}r=2:ret #37:call60:if r=4}q:if r=6}q:if r<>1}r if i>9999}}if i<10012}q:if i>10011}}if i<10031}}r=7 if i>10030}}if i<10040}}r=2:ret #38:call60:if r=4}q:if r=6}q:if r<>1}r if i>9999}}if i<10012}q:if i>10011}}if i<10031}}r=7:ret #39:call60:if r=4}q:if r=6}q:if r<>1}r if i>9999}}if i<10012}q:ret #60 i=mloc:if i>9999}60 #61:k=kyck:if k<>0}62:I=MLOC:IF I>9999}}IF I<10079}66 i=mlin:if i=0}61:if i>99}64:if i>x-2}61:if i=j}61:j=i:goto63 #62:if k=13}65:if k=27}69 if k=272}}if j>0}}j=j-1:if k=280}}if j64}}if k<91}}k=k+32:if k>96}}if k<123}70 #63:wlcc L(j):goto61 #64:i=i-int(i/100)*100:j=i:i=mloc:if i>9999}}if i<10079}66 #65:r=0:ret #66:r=1:ret:|top bar| #67:r=2:ret:|PgUp| #68:r=3:ret:|PgDn| #69:r=4:ret:|ESC| #70:r=5:k=k-97:ret:|A to Z| #71:r=6:ret:|END| #72:r=7:ret:|HOME| #80:call28:x=0:i=0:j=0 WIND r1c0wr22wc78BB1BF15B7F0" INSTRUCTION LINE (1 of 3) The instruction line is made up of seven 78 character lines wrapped around to form a 546 character instruction area. The special key functions for the instruction line are listed below. Cursor keys: Moves the cursor around the instruction line within the data that has been entered. (Mouse can be used too.) HOME key: Moves the cursor to the start of the instruction line. END key: Moves the cursor to the end of the instruction line data. INSERT key: Toggles between INSERT mode and OVERtype mode. The bottom information bar will display the mode you are in. DELETE key: Deletes the character the cursor is on. Back Space key: <-- Deletes the character left of the cursor. F1 to F8 keys: Inserts information as defined by FKEY statements. (Does not work for an INP response) ":call 38:if r=7}10 #90:call27 wind" INSTRUCTION LINE (2 of 3) F9 key: Inserts the last decimal answer into the instruction line. If responding to an INP statement, the last variable value or memory string will be returned if nothing is entered yet. F10 key: Recalls the previous instruction line for editing. (if nothing is entered on the new line yet) S-F1 to S-F8 keys: Used to display environment pop-down menus. (The mouse is normally used for this.) SHIFT-F10 key: Display the HELP WINDOW. (not valid when in an INP or KYIN response) (not valid in application or utility files) CTRL-X: Clear all entered characters from the instruction line. ESC key: Quits the MATHX program. Also quits an INP response with no change the variable or memory contents. ":call37:if r=7}10:if r=2}80 CALL26 wind" INSTRUCTION LINE (3 of 3) Math Instructions: KEY DEFINITION EXAMPLE + Entering positive sign or addition. 125+258 - Entering negative sign or subtraction. -15-128 * Multiplication instruction. 159*X*Y / Division instruction. Z/158 ^ Power instruction. X^2 . Enter decimal point. .012*2.369 ( ) Input parentheses. SIN(A+B) [ ] Input exponent for scientific notation. 1.589 [-25] E Alternate scientific notation form. 1.589 E-25 Constant: PI or ã Input Pi. Example: pi*6.875 Note: After completing a calculation, if one of + - * / ^ keys are hit first, the preceding calculation result is used as data for the next calculation. Starting with any other key, including the space key, or separating the calculations with a second hit of the key, will cause the program not to use the preceding result. ":call36:if r=2}90:goto10 #100:call29:x=0:i=0:j=0 wind r1c0wr22wc78BB1BF15B7F0" PRIORITY OF CALCULATIONS Calculations are done from the left to the right with some exceptions. Functions have priority over power. Power has priority over multiplication or division. Multiplication or division has priority over addition or subtraction. Calculations in parentheses will occur first. For multiple parentheses, calculations in the innermost parentheses have priority over all others. Compound functions are calculated from right to left. example (LOG SIN DEG 12.3456) A string of powers are calculated from right to left. example (x^y^2) Example of order of calculations: 1.2 + PI * SQR 2 - LN TAN (10+25) ^ 2 / SQR 5 ³ ³ À 1 Ù ³ ³ À 4 Ù ³ ³ ³ ³ ÀÄÄ 2 ÄÙ ³ ÀÄ 5 ÄÙ ³ ³ ³ ÀÄÄ 3 ÄÄÄÙ ÀÄÄ 6 ÄÙ ³ À 8 Ù ³ ÀÄÄÄÄÄ 7 ÄÄÄÄÙ ³ ³ ÀÄÄÄÄ 9 ÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄ 10 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ":call39:go10 #150:call28:x=0:i=0:j=0 wind r1c0wr22wc78BB1BF15B7F0" MATH FUNCTIONS: (1 of 3) SIN Trigonometric function Sine. COS Trigonometric function Cosine. TAN Trigonometric function Tangent. ASN Inverse trigonometric function sine. ACS Inverse trigonometric function cosine. ATN Inverse trigonometric function tangent. SINH Hyperbolic Sine function. COSH Hyperbolic Cosine function. TANH Hyperbolic Tangent function. ASNH Inverse Hyperbolic Sine function. ACSH Inverse Hyperbolic Cosine function. ATNH Inverse Hyperbolic Tangent function. "nnnnnn:call 38:if r=7}10 #160:call27:wind" MATH FUNCTIONS: (2 of 3) ABS Absolute value. DEG Degree.minute second to decimal conversion. DMS Decimal to degree.minute second conversion. EXP Exponential function of e. LN Natural logarithm. (base e) LOG Common logarithm. (base 10) CINT Integer. (by rounding the fractional portion) FIX Integer. (truncated integer) INT Integer. (next lower integer) SGN Signum. (result is 1 if positive, 0 if zero, -1 if negative) SQR or û Extraction of square root. RAND Generate a random whole number from 0 to 99. Does not need any other information or seed. Wherever RAND is encountered, a random number will be used in its place. Example RAND*100+RAND NOTE: All two or three letter functions must have a space between the function and a variable or other function. ":call37:if r=7}10:if r=2}150 call26:WIND; MATH FUNCTIONS: (3 of 3) F$A to F$Z Special definable functions using a string memory as the definition of the function. Format: F$letter expression Example 1: $Z="2*Z^2+4*Z-16":F$Z 5 Wherever Z is in the definition of $Z, the value 5 will be put in its place to obtain the result of F$Z for 5. Note: variable Z is not required in the definition and if not used, 5 would be a dummy value. A dummy value is required but not used. Example 2: $x="x^2+x+1":$y="y^3+y^2+y+1":F$X F$Y 6 Here two functions are defined and the result of the F$X for F$Y for 6 will be displayed. (F$Y for 6 is done first) NOTE! When the variable used in the definition of a function is the same as the defining string letter, that variable is temporarily given the value of the function expression. The old value of that variable is saved. All other variables are not affected and can be used in the definition if needed. ;:call36:if r=2}160:goto10 #350:call28:x=0:i=0:j=0 wind r1c0wr22wc78BB1BF15B7F0" ANSWER SYSTEM (1 of 2) The MATHX programs can display answers to problems or values of variables in two forms. Normal decimal form and Hexadecimal form. Hexadecimal form: This is done by using the DSP, PRN, or the DPRN statements and the H sub-statement. Example: 1000*256:DSP H. This display sub-statement displays the answer in Hex form for the previous math expression. The Hex answer for the previous example will be displayed as 0003E800 (HEX). There are two statements that control the Hex display. They are CON and COFF. They control the way negative Hex answers will be handled. See the STATEMENTS section for descriptions on the use of these statements. "nnn:call 38:if r=7}10 call26:wind" ANSWER SYSTEM (2 of 2) Decimal form: The MATHX programs use 16 digit binary coded decimal math for all calculations. The maximum number of digits that can be displayed is 14. The answer is rounded off to the 14th place. This can be changed to a smaller number through the use of control statements. The following statements change the way the answer will be displayed: DIGL, DIGR, EON, EOFF AON, AOFF, RON, ROFF, EREQ, XON and XOFF. See the STATEMENTS section for information on these statements. These statements will change the maximum number of digits allowed on the left and right side of the decimal point, whether scientific notation is allowed and its display form and if the display will use commas. Usually if the answer cannot be displayed in the form allowed, scientific notation will be used. If scientific notation is not allowed then a DISPLAY FORM ERROR will result. For normal math use, the default settings will be good, but, for some special purpose application programs you may want to tailor your answer form. "n:call36:if r=2}350:goto10 #400:call28:x=0:i=0:j=0 wind r1c0wr22wc78BB1BF15B7F0" DATA INPUT (1 of 4) Numbers can be entered into the program in two forms. Like the answer display system, numbers can be entered in decimal or hexadecimal form. Decimal input: The first thing to enter is the sign of the number. Use the + or - keys for this. (For plus values the + sign is can be omitted.) Normal input or scientific notation can be used. The exponent (scientific notation) can be entered in two ways. Using brackets with the sign of the exponent in the brackets before the number or using a capital E before the exponent. Example: 1.23 E-19 or 1.23 [-19]. The largest exponent that is allowed on entry is [+99] or [-99] but answers will be displayed up to [+200] or [-200]. Up to 16 digits are allowed on entry not counting leading zeros. "n:call 38:if r=7}10 #410:call27:wind" DATA INPUT (2 of 4) Here are some examples of allowed decimal inputs. +12345678901234 -12345.6789 .000000000012345678901234 same as 1.2345678901234 E-11 1.23456 [-12] same as 1.23456*10^-12 .000123456 E25 same as 1.23456 [+21] 123456 E20 same as 1.23456 [+25] -1234567890000000 same as -1.23456789 E+15 Note: If you are entering a negative number (or a + sign that is not for addition) at the beginning of a new instruction line, first hit the space bar or the key so that the program doesn't bring up the previous answer first. See the MANUAL CALCULATIONS section. "nnn:call37:if r=7}10:if r=2}400 #420:call27:wind" DATA INPUT (3 of 4) Hexadecimal input: The ` character is used at the start and end of a hexadecimal number to be input. A minus sign can be entered before the hex number to input a negative value. The hex number is converted to decimal by the MATHX program for all math operations. Here are some examples of hexadecimal inputs. `AF301` `ffffffff` (this is the largest hex number allowed) `-0012fac9` `+0100000F` `-fe000` `00abcdef12` "nnnn:call37:if r=7}10:if r=2}410 call26:wind" DATA INPUT (4 of 4) VARIABLES AND STRING MEMORIES Direct input to variables is done by the use of the = character. The format for this is variable=expression. (Only the result is saved.) Examples: A=1.2345 B=12*sin15 C=`af2b` D''=x^3-y^2+z Direct input to string memories use the same method with one additional requirement. The string must be put between ";" or ;"; characters. Formats: $letter=";"string" or: $letter=;";string;. (60 characters max.) or: $letter=$letter or: $letter=$(expression) Examples: $A=";" degrees ";" $B=;End of program.; $c=";"c^2+c-1" $d=$(6) (same as $D=$F) $e="" (clears the string memory) $f=$x+$y+$(2)+" end." ;:call36:if r=2}420:goto10 #450:call28:x=0:i=0:j=0 wind r1c0wr22wc78BB1BF15B7F0" MANUAL CALCULATIONS (1 of 3) There are two general type of manual calculation methods that can be used with the MATHX programs. The first is the subsequent calculations method. In this method you hit the ENTER key every time you put in a operation and a number or variable. The answer will be displayed at each step of the way. What happens is every time one of the operation characters + - / * ^ is entered at the start of the instruction line, the program brings up the answer to the previous math expression and then puts in the operation. If the instruction line is started with any character other then the five operation characters given above, the math expression will be treated as a new math problem. "nnnnnnn:call 38:if r=7}10 #460:call27:wind" MANUAL CALCULATIONS (2 of 3) Example: For the expression 125.12 + 12.23 - 159.56 + 6.12 + 45 First input: 125.12+12.23 Answer returned: 137.35 Then input: -159.56 (will be displayed as: 137.35-159.56 ) Answer returned: -22.21 Then input: +6.12 (will be displayed as: -22.21+6.12 ) Answer returned: -16.09 Then input: +45 (will be displayed as: -16.09+45 ) Answer returned: 28.91 "n:call37:if r=7}10:if r=2}450 call26:wind" MANUAL CALCULATIONS (3 of 3) The second way of entering a math problem is to enter the whole math expression at one time and get one answer. Same example as above: Input: 125.12+12.23-159.56+6.12+45 Answer returned: 28.91 Note: If you are starting a math expression with a negative number, hit the space bar first or the key again so the program will not treat it as a subtraction operation. "nnn:call36:if r=2}460:goto10 #500:call28:x=0:i=0:j=0 wind r1c0wr22wc78BB1BF15B7F0" ERROR MESSAGES (1 of 9) APPLICATION file not loaded! Displayed when an attempt is made to use an application and one has not been loaded or when there is an application file loading error. DATA STATEMENT ERROR (VARIABLE TOO BIG) Displayed when the variable used for a DATA statement has a value that is bigger then the number of data positions in the data part of the DATA statement. example X=6:DATA X {1,10,20,30,40,50} (remember the zero position in the data part of the statement) DISPLAY FORM ERROR Displayed when the decimal answer cannot be displayed in the form allowed by DIGL and XOFF statements. Set XON or make DIGL bigger. ":call 38:if r=7}10 #510:call27:wind" ERROR MESSAGES (2 of 9) DIVIDE BY ZERO ERROR Displayed when at some point in the math expression an attempt is made to divide by zero or divide by a variable that equals zero. ERROR, Bad COMSPEC data! Displayed when using the DOS command and the program cannot find COMSPEC= in the environment. (EDITOR statement over 40 characters long) SYNTAX ERROR Displayed when the path and command are over 40 characters long. "nnnn:call37:if r=7}10:if r=2}500 #520:call27:wind" ERROR MESSAGES (3 of 9) EXPONENT OVERFLOW ERROR Displayed when at some point in the math expression the exponent of the answer register goes over 200. FILE LOAD ERROR, could not find file! Displayed when the file being asked for can not be found. Check for the correct path and name. FILE LOAD ERROR, could not open file! Displayed when the file being loaded cannot be opened by DOS. FILE LOAD ERROR, not enough memory! Displayed when there is not enough memory left in RAM to hold the contents of the file being loaded. "n:call37:if r=7}10:if r=2}510 #530:call27:wind" ERROR MESSAGES (4 of 9) FILE LOAD ERROR, wrong file type! Displayed when the variables, string memories or parameters setup file being loaded is not of the right length to be of the correct MATHX version. (Those file lengths may change for new versions.) FILE READ ERROR! Displayed when DOS is not able to read the file being loaded. FILE WRITE ERROR, access denied! Displayed when the variables or string memories are being saved to a read only disk or for some other reason the program was denied access to the disk. FILE WRITE ERROR, not enough memory! Displayed when there is not enough memory on the disk for the variables or string memories file. ":call37:if r=7}10:if r=2}520 #540:call27:wind" ERROR MESSAGES (5 of 9) (FKEY definition over 40 characters long) SYNTAX ERROR Displayed when there is more then 40 characters in the definition part of the FKEY statement. FUNCTION DEFINITION SYNTAX ERROR Displayed when the string for the definable function being used has a syntax error in it. Look at the string statement used by the function for the error. GOTO or CALL location number 0 not allowed! Displayed when an attempt is made to define a GOTO location as 0. (:#0:) Location 0 is reserved for the start of the instruction line or the start of the math application or utility file. "nn:call37:if r=7}10:if r=2}530 #550:call27:wind" ERROR MESSAGES (6 of 9) GOTO or CALL location number not defined! Displayed when an attempt is made to GOTO a location that does not have a # number defined position. GOTO or CALL location number too big! (over 25) Displayed when an attempt is made to GOTO a location greater then 25 in the instruction line or when an attempt is made to define a GOTO location that is greater then 25 in the instruction line. GOTO or CALL location number used already! Displayed when an attempt is made to define two or more locations the same number. HEX OVERFLOW ERROR! Displayed when the Hex value is greater then 0FFFFFFFF. (This is the limit of the Hex register) ":call37:if r=7}10:if r=2}540 #560:call27:wind" ERROR MESSAGES (7 of 9) LOG OF ZERO OR NEGATIVE NUMBER ERROR Displayed when an attempt is made to get the LOG or LN of zero or a negative number or a variable that equals zero or a negative number. MATHX.ENV file not loaded! Displayed when the MATHX program could not load the file. This file is used for the pop-down menu operating environment. MATHX.HLP file not loaded! Displayed when asking for HELP and the help file was not loaded or as a result of a loading error. Parameter too long ERROR! Displayed when a command line parameter has more then 40 characters. "n:call37:if r=7}10:if r=2}550 #570:call27:wind" ERROR MESSAGES (8 of 9) POWER (ROOT) OF NEGATIVE NUMBER ERROR Displayed when an attempt is made to take a negative number or variable to a power that includes a root portion. example -2^2.125 Printer does not acknowledge or is out of paper! Displayed when PON statement is active and an attempt is made to send something to the printer and the printer does not acknowledge or is out of paper. (printer not turned on) SQUARE ROOT OF NEGATIVE NUMBER ERROR Displayed when an attempt is made to square root a negative number or a variable that has a negative value. STACK ERROR, TOO MANY () Displayed when over 100 parentheses are used in an expression. "n:call37:if r=7}10:if r=2}560 #580:call27:wind" ERROR MESSAGES (9 of 9) SYNTAX ERROR Displayed when data or an instruction is missing or not in the correct form or when a statement is not in the correct form or is not separated with a colon or comma. The instruction line is returned and the cursor is set at the location of the error. SYNTAX ERROR THE NEXT 50 CHARACTERS FROM THE POINT OF ERROR ARE: Displayed when the application, utility or defaults file being used has a syntax error. If so, the next 50 characters from the point of the error or until the end of the file, which ever comes first, will be displayed. (end of file is indicated by a small left arrow) Too many parameters ERROR! Displayed when the command line has more then just the name of a file to be loaded or when an application or utility file has more then three characters in its extension. ":call37:if r=2}570:goto10