Conditional structures: Difference between revisions
Content added Content deleted
m (added debug/platform example) |
|||
Line 1,878: | Line 1,878: | ||
8 digit \ eight |
8 digit \ eight |
||
34 digit \ Out of range!</lang> |
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}}== |
=={{header|Fortran}}== |