Hi Steady,
I've tried to compile your code - and it works fine.
But I'm afraid there is a bug when you check the errorcode.
When the object is created, the code in retVal is invalid.
So you must write
if (sim.obj[OBJ_AREXX])
instead of
if (retVal)
I used StormC 4 for this

greetings from germany
cygnusEd