04-29-2015, 03:38 PM
boriel Wrote:Sinclair Wrote:Is there any way that a program in ZX BASIC returns a value?This case is the same as in normal machine code. The value you can return is always a 16 bit integer stored in the BC register.
That I need is, once end my program this return a value to the +3 BASIC as in the following example:
Code:10 LOAD "program.bin" CODE 32768
20 LET r = USR 32768
30 PRINT r
Thank you.
You can use END for that:
END 27613
Other than that, you must store the result in RAM and BASIC must PEEK from there.
It doesn't work in a program compiled with some lines of code.
Code:
2 Variable not found, 30: 1
However, your simple example works :!:
![[Image: FootSign.jpg]](http://retrocomputing.esy.es/images/FootSign.jpg)