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 - iifi() evaluate a conditional int expression http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 iifi()              Evaluate a conditional int expression
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   func int iifi extern
   param value logical lExpression, ;
         value int     iNumberTrue, ;
         value int     iNumberFalse

 Arguments
   lExpression is a conditional expression for evaluation.
   iNumberTrue is the value to return if lExpression is true.
   iNumberFalse is the value to return if lExpression is false.

 Return
   An int whose value depends on the result of conditional evaluation.

 Description
   The iifi() function evaluates lExpression and returns the int value
   supplied in either of the two alternative parameters, depending on the
   result of the conditional evaluation. Note that the function simply
   selects between the return values of the two alternative expressions,
   both of which are evaluated before the call.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc Test_iifi
   set margin to iifi( getmargin() == 0, 5, getmargin() + 3 )
   ? getmargin()
   endproc

   proc main
   Test_iifi()
   endproc

See Also: if iifb() iifg() iifn()

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