Memory Bank Address

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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!
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by dmoc.

Thanks, forgot about that.
Post Reply