=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 03-13-93 (22:26) Number: 86 From: QUINN TYLER JACKSON Refer#: NONE To: ALL Recvd: NO Subj: formula solver 4/7 Conf: (35) Quick Basi --------------------------------------------------------------------------- '>>> Start of page 4. SUB sqjApplyOp (Op$, r, h) ' This is the meat of the operator section, and can be modified to ' includ ANY symbol as an operator, or any two byte symbol combination. ' Any symbol added ha s to be added to the constant that sets its ' level of precedence. SELECT CASE Op$ CASE "-" ' subtraction r = r - h CASE "+" ' addition r = r + h CASE "*" ' multiplication r = r * h CASE "/" ' division r = r / h CASE "\" ' integer division r = r \ h CASE "%" ' modulo division r = r MOD h CASE "^", "**" ' exponentation r = r ^ h CASE "]" ' the rth root of h r = h ^ (1 / r) CASE "?" ' random number from 0 to h, to r decimal places r = (INT(RND * h * 10 ^ r)) / 10 ^ r CASE "<<" ' bitshift left h by r bits r = INT(h) * 2 ^ INT(r) CASE ">>" ' bitshift right h by r bits r = INT(h) \ 2 ^ INT(r) CASE "<" ' logical less than than r = r < h CASE "<=", "=<" ' logical less than or equal to r = r <= h CASE ">" ' logical greater than r = r > h CASE ">=", "=>" ' logical greater than or equal to r = r >= h CASE "==" ' logical equality r = r = h CASE "<>" ' logical inequality r = r <> h CASE "&" ' bitwise AND r = r AND h CASE "|" ' bitwise OR r = r OR h CASE "~" ' bitwise XOR r = r XOR h END SELECT END SUB SUB sqjAssignVar (VarName$, VarValue) ' First we see if this variable is already in the list FOR i% = 1 TO VariPtr IF VarMem(i%).Nom = VarName$ THEN ' Since it was, just change its value VarMem(i%).Valu = VarValu EXIT SUB END IF NEXT i% ' Since it wasn't, put it there VariPtr = VariPtr + 1 '>>> Continued on page 5. --- Maximus/2 2.01wb * Origin: The Nibble's Roost, Richmond BC Canada 604-244-8009 (1:153/918) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20