Page 1 of 1

Allow ProcedureReturn & Break in Select/EndSelect Blocks

Posted: Sun May 03, 2009 12:05 pm
by Tranquil
Topic says all.

I was very astonished as I looked in the BUG-Reports section that this seems not to be allowed.

Break and ProcedureReturn should cleanup the stack in every situation it breaks out a look or a Select/ EndSelect block or the compiler should even give a warning on this.

Posted: Sun May 03, 2009 12:42 pm
by eesau
ProcedureReturn inside a Select/EndSelect-block works just fine or am I missing something?

Posted: Sun May 03, 2009 12:52 pm
by eddy
it works for me
x86 winXP sp3

Code: Select all

For i=0 To 10
   Select zero
      Case 0
         Debug "break - exit of loop"
         Break
   EndSelect
Next

Debug "ok"

Procedure test()
      Select zero
         Case 0
            Debug "ProcedureReturn - exit of procedure"
            ProcedureReturn
      EndSelect
EndProcedure

test()

Debug "ok"

Posted: Sun May 03, 2009 1:18 pm
by srod
Yep I use it all the time.

Posted: Sun May 03, 2009 1:28 pm
by Tranquil

Posted: Sun May 03, 2009 1:45 pm
by Kaeru Gaman
the question to be answered is, if it is a QUAD problem.

if yes, it should be at least stated in the Help that Select is not suitable for Quads.

to my knowledge, the stack processing was fixed thus FakeEndSelect was removed.
History sais it was with 3.62

it was fixed for LONG-Selects, and if it wasn't extended meanwhile,
it's obvious that there will be a mistake now when the Select handles a Quad and the compiler cleans the Stack for a LONG-Select.

Re: Allow ProcedureReturn & Break in Select/EndSelect Bl

Posted: Sun May 03, 2009 2:14 pm
by Trond
Tranquil wrote:Topic says all.

I was very astonished as I looked in the BUG-Reports section that this seems not to be allowed.

Break and ProcedureReturn should cleanup the stack in every situation it breaks out a look or a Select/ EndSelect block or the compiler should even give a warning on this.
This should be allowed, it must be a bug.

Posted: Sun May 03, 2009 11:31 pm
by Fred
It should work.