Switch question - yet again!

new topic     » topic index » view thread      » older message » newer message

Windows 7 pro sp1 euphoria: 4.0.5 (362497032f33, 2012-10-11)

It's been nearly a week and again I am lost. I'm missing something but I don't see what it is.

include std/stack.e as st 
include jd/jd.e 
constant op = st:new(FILO)	--create a new stack item 
push(op,23)					--add integer 23 to stack 
pf(op,"op in main")			--pf() prints anything inside the parenthesi 
pf(peek_top(op),"Top of the stack op")  --just to show there is really something on the stack 
ak()				--forces the command window to stay open 
procedure show_stack(integer stk) 
pf(stk,"stk in procedure") 
pf(op,"op in procedure") 
switch stk do                    --this is line 15 
	case op then 
		puts(1,"in first case...\n") 
	case 3 then 
		--just another case! 
end switch 
end procedure 

Produces the following output:

op in main => 2
Top of the stack op => 23
stk in procedure => 2
op in procedure => 2

C:\Users\Jesse\Software\Euphoria\lexer\z.exw:15 in procedure show_stack()
A machine-level exception occurred during execution of this statement (signal 5)

... called from C:\Users\Jesse\Software\Euphoria\lexer\z.exw:8

--> See ex.err

Press Enter...

Any help would be appreciated...

thanks & Regards,

new topic     » topic index » view thread      » older message » newer message


Quick Links

User menu

Not signed in.

Misc Menu