In order to use it in a program, I'm trying to replicate KEYIN in S*BASIC, without success.
First try, with DO:
Code: Select all
defproc keyin(sbasic_code$):rem first try
rem Evaluate a string that contains S*BASIC code
rem It doesn't work, because DO stops the program.
loc file$,channel
let file$="ram1_keyin_tmp"
let channel=fop_over(file$)
rem if channel<0:fatal_error "keyin: "&channel
print #channel,sbasic_code$
close #channel
do file$
delete file$
enddef
Code: Select all
defproc keyin(sbasic_code$):rem second try
rem Evaluate a string that contains S*BASIC code
rem It doesn't work, because MERGE cannot be used inside a procedure or while any procedure is active.
loc file$,merge_line,channel
let file$="ram1_keyin_tmp"
let merge_line=32767
let channel=fop_over(file$)
rem if channel<0:fatal_error "keyin: "&channel
print #channel,merge_line&"defproc do_keyin:"&sbasic_code$&":enddef"
close #channel
merge file$
do_keyin
dline merge_line
delete file$
enddef
Any suggestion will be apreciated. I'm running out of ideas at the moment. I've searched for something similar in any toolkit I know of, but found nothing.