BBS: Inland Empire Archive Date: 03-13-93 (22:26) Number: 338 From: QUINN TYLER JACKSON Refer#: NONE To: ALL Recvd: NO Subj: formula solver 5/7 Conf: (2) Quik_Bas
'>>> Start of page 5. IF VariPtr <= VARMAX THEN VarMem(VariPtr).Nom = VarName$ VarMem(VariPtr).Valu = VarValue ELSE PRINT "Out of variable space!" END IF END SUB SUB sqjGetOp TOKEN$ = "" DO WHILE MID$(expression$, Ptr, 1) = " " Ptr = Ptr + 1 LOOP IF INSTR(MID$(expression$, Ptr, 1), "(") THEN TOKEN$ = "(" Ptr = Ptr + 1 EXIT SUB END IF IF INSTR(MID$(expression$, Ptr, 1), ")") THEN TOKEN$ = ")" Ptr = Ptr + 1 EXIT SUB END IF IF INSTR(OPERATOR$, MID$(expression$, Ptr, 1)) THEN TOKEN$ = MID$(expression$, Ptr, 1) Ptr = Ptr + 1 ' see if it's a compound operator IF INSTR(OPERATOR$, MID$(expression$, Ptr, 1)) THEN TOKEN$ = TOKEN$ + MID$(expression$, Ptr, 1) Ptr = Ptr + 1 END IF TypeToken = OperatorClass EXIT SUB END IF Temp$ = MID$(expression$, Ptr, 1) IF Temp$ >= "0" AND Temp$ <= "9" THEN ' Build up a number from its digits DO WHILE INSTR(" " + OPERATOR$, MID$(expression$, Ptr, 1)) = 0 TOKEN$ = TOKEN$ + MID$(expression$, Ptr, 1) Ptr = Ptr + 1 LOOP TypeToken = DigitClass END IF Temp$ = MID$(expression$, Ptr, 1) IF Temp$ >= "a" AND Temp$ <= "z" THEN ' Build up a variable name based upon letters DO WHILE INSTR(" " + OPERATOR$, MID$(expression$, Ptr, 1)) = 0 TOKEN$ = TOKEN$ + MID$(expression$, Ptr, 1) Ptr = Ptr + 1 LOOP TOKEN$ = STR$(fqjFetchVar(TOKEN$)) TypeToken = DigitClass END IF '>>> Continued on page 6. --- Maximus/2 2.01wb * Origin: The Nibble's Roost, Richmond BC Canada 604-244-8009 (1:153/918)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET