Page 1 of 1

Posted: Fri Feb 28, 2003 3:03 pm
by BackupUser
Restored from previous forum. Originally posted by dmoc.

In a procedure I am doing the following but it crashes on the return.
I have tried MBuffer, *MBuffer and @MBuffer. Code is ok outside of
a procedure. Any ideas?

Procedure.l GetSomeAddress(...)
...
*MBuffer = AllocateMemory(#MBNum, 16)
...
ProcedureReturn MBuffer; << CRASH!

Posted: Fri Feb 28, 2003 4:05 pm
by BackupUser
Restored from previous forum. Originally posted by dmoc.

Discover the problem: the "ProcedureReturn *MBuffer" was inside a SELECT-CASE statement.
When I re-coded to allow the proc to drop through to the end, the problem disappeared.
Is this a known bug?

Posted: Fri Feb 28, 2003 4:13 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

It is known, but not a Bug :)
It is a stack thing, you have to use FakeEndSelect before you exit a
Select/Endselect with Procedurereturn (same as with Goto)

Timo

Posted: Fri Feb 28, 2003 4:16 pm
by BackupUser
Restored from previous forum. Originally posted by dmoc.

Thanks, forgot about that.