..also i found old topic by SteveA( i miss this guy)..
interesting he use same Factor() & term() in his expression parser
like me in ruben ( but i ue this for expression evaluator) ..funny.
SUB Term()
Local ch$, pii, tValue, ismultop, ich
Factor()
tValue = dreturn
pii = epos
ch$ = pstring$(pii)
IsMultop(ch$)
ismultop = ireturn
WHILE (ismultop = 1)
ich = ASC(ch$)
SWITCH ich
CASE 42
Match()
Factor()
tValue = tValue * dreturn
BREAK
CASE 47
Match()
Factor()
tValue = tValue / dreturn
BREAK
CASE 94
Match()
Factor()
tValue = tValue ^ dreturn
BREAK
CASE 37
Match()
Factor()
ireturn = INT(dreturn)
tValue = INT(tValue)
tValue = mod(tValue, ireturn)
BREAK
END SWITCH
pii = epos
ch$ = pstring$(pii)
IsMultop(ch$)
ismultop = ireturn
WEND
dreturn = tValue
END SUB
' ---------- end Term ----------
SUB Factor()
Local ch$, pii, isalpha, fvalue
pii = epos
ch$ = pstring$(pii)
IF (ch$ = "(") THEN
Match()
Expression()
fvalue = dreturn
Match()
ELSE
GetNum()
fvalue = dreturn
ENDIF
dreturn = fvalue
END SUB
' ---------- end Factor ----------