In Minerva, there is a more or less undocumented vector (CA.EVAL, $14E) which evaluates a tokenised expression. The description in the Minerva manual is incomplete, but the source code contains an accurate description about its parameters.ql_freak wrote: Sat Jun 28, 2025 1:45 am There is no code (not even unvectored) in QDOS, which can evaluate a string as an expression. I assume if you have a line like:
PROCname expression (or FuNcname(expression))
e.g.:
myProc sin(pi/6)*2
SuperBASIC tokenizes the expression (sin(pi/6)*2) and then there seems to be a (none vectored) routine, which can evaluate this tokenized expression.
There (IMHO) must be such a code in QDOS else the above code (myProc ...) shouldn't be possible.
But in order to evaluate an expression in a string, you have to parse (and tokenise) it first, which isn't possible from a running interpreter unless you resort to the CONTINUE trick as mentioned. A neater way would be to feed this string into a second interpreter under Minerva or SMSQ/E which tokenises and evaluates it. There are also obscure vectors to parse a S*BASIC line into a tokenised line (see this source file near the end on how to use these).
One remaining problem will be the use of variables, for which the values have to be substituted from the calling program since the second interpreter doesn't know about them.
Well, I think I've found a new programming challenge...
