forum-msg-id-130427-edit

Original date:2016-09-28 12:31:26 Edited by: jessedavis Subject: Switch question - yet again!

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 
show_stack(op) 
 
ak()				--forces the command window to stay open 
 
procedure show_stack(integer stk) 
pf(stk,"stk in procedure") 
pf(stk,"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,
jd

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu