home *** CD-ROM | disk | FTP | other *** search
- CASE "CALC","EVAL","WHAT"
- ' Build an expression to calculate by stringing together
- ' all pushed arguments that may constitute an arithmetic
- ' expression. When we come to a non arithmetic symbol or
- ' bit of text, push it back and calculate what we have.
- A$=""
- DO
- B$=POPARG$
- IF VERIFY(B$,"01234567890 .+-/\*^()><=") THEN
- PUSHARG B$
- EXIT LOOP
- END IF
- A$=A$+B$
- LOOP WHILE ArgPtr%>0
- PUSHARG STR$(CALC(A$))
-
- CASE "+","-","/","\","*","^","(",")",">","<","=","&"
- PUSHARG PRG$
-