How to use MLOAD? - Solved: ( EVALUATE)
Christof Eb.
Posts: 1,195
Hi,
can anyone direct me to some example, how to use mload ( or another word ) to immediately interprete source code, which is given in a string?
The problem is, that the code is only executed, AFTER switching back to the interpreter.
Thank You in advance! Christof
TAQOZ# : ml --- " 1 . " --- dup --- dup len$ 1- + $000D swap ! --- mload --- 2 . --- ; --- ok TAQOZ# --- ok TAQOZ# ml --- 2 ok TAQOZ# 1 . --- 1 ok
Comments
.... OK solved, it's EVALUATE and you have to append CR NULL to the string.
Mload like fload do not switch into the interpreter, they only switch the keyboard stream to ram or to file, so that it will be used for any KEY command.
Edit: Switching back to normal after evaluate is still not always fine.
Here is a modified evaluate, which already has CR appended instead of BLANK and which switches back to normal serial keyboard before it envokes a word. Also it stops evaluation, if backslash comment appears. In this case you have to type CR.