[Vm-dev] Return a value from the image to the VM

Bert Freudenberg bert at freudenbergs.de
Sun Nov 22 09:45:56 UTC 2009

On 22.11.2009, at 05:07, Rob Rothwell wrote:
> Hello...
> For scripting purposes, I just want to be able to do something like:
> SmalltalkImage current quit: errorCode.
> So that in the VM I can essentially do:
> return errorCode.
> at the end of sqMain?
> Any pointers on how to push a value BACK to the VM?  I have only barely dabbled with adding some custom menu commands to the VM long ago, and have no idea where to start.

You would need to add a primitive to set the errorCode. This would be stored in an interpreter variable. Then the VM's exit code would be modified to retrieve that value.

- Bert -

More information about the Vm-dev mailing list