Jump to content

Conditional structures: Difference between revisions

m (added debug/platform example)
Line 1,878:
8 digit \ eight
34 digit \ Out of range!</lang>
===Execution Vector 2===
This method was used by the late Jim Kalihan and Dr. Julian Nobel
<lang Forth>: CASE: ( -- -7) CREATE ;
 
\ lookup execution vector and compile
: | ( <name> ) ' compile, ;
 
: ;CASE ( n -- ) DOES> OVER + + @ EXECUTE ;
 
: FOO ." FOO" ;
: BAR ." BAR" ;
: FIZZ ." FIZZ" ;
: BUZZ ." BUZZ" ;
 
CASE: SELECT ( n -- ) | FOO | BAR | FIZZ | BUZZ ;CASE
 
\ Usage: 3 SELECT
</LANG>
 
=={{header|Fortran}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.