Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - endcase multiple conditional branch end http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 endcase             Multiple conditional branch end
------------------------------------------------------------------------------
 Syntax
   do case
   [ case <condition> ]
      [ <code> ]
   [ otherwise ]
      [ <code> ]
   endcase

 Arguments
   None.

 Description
   The endcase statement closes a conditional branch structure started
   with the do case statement.                                                "

 Example
   #define EXAMPLE_STATEMEN
   #include example.hdr

   proc DispMsg static
   param value uint uRow, value uint uCol, const char cText
   @ uRow, uCol ?? cText
   endproc
   
   proc Test_endcase
   vardef
      _SLIST pList
      uint   n
      uint   uChoice
   enddef
   pList := pickinit()
   for n := 0 to 6
      pickadd( pList, __daynames[ n ] )
   next
   clear
   uChoice := pickdisp( pList, 8, 35, 14, 45 )
   do case
   case uChoice == 0
      @ 20, 0 ?? "You seemingly pressed Escape"
   case uChoice == 1
      @ 20, 0 ?? "You selected", pickstr( pList, uChoice )
   case uChoice == 2
      @ 20, 0 ?? "The", istr( uChoice ) + "nd day of week is", ;
         __daynames[ uChoice - 1 ]
   case uChoice == 3
      DispMsg( 20, 0, "Let's call a function" )
   otherwise
      @ 20, 0 ?? "The docs writer became tired at this point"
   endcase
   pickclear( pList )
   endproc

   proc main
   Test_endcase()
   endproc

See Also: do case

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson