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 - if simple conditional branch start http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 if                  Simple conditional branch start
------------------------------------------------------------------------------
 Syntax
   if <condition> ]
      [ <code> ]
   [ else ]
      [ <code> ]
   endif

 Arguments
   <condition> is an expression that evaluates to a logical value.

 Description
   The if statement implements conditional execution of instructions.
   The conditionn given for the if statement is evaluated and the code
   following the if keyword is executed if and only if the logical
   expression is true.

   If the logical expression evaluates to false, program execution either
   continues with the commands following the endif statement, or with the     "
   commands between the optional else clause and endif.                       .

   The if constructs may be nested.                                           "

 Example
   #define EXAMPLE_STATEMEN
   #include example.hdr

   #define LIMIT 10
   
   proc Test_if
   vardef
      uint nNumber
   enddef
   nNumber := 123
   if nNumber > LIMIT
      ? "Number is greater than "
   else
      ? "Number is less than or equal to "
   endif
   ?? istr( LIMIT )
   endproc

   proc main
   Test_if()
   endproc

See Also: do case else endif

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