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 - iifb() conditional expression for byte values http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 iifb()              Conditional expression for byte values
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   func byte iifb extern
   param value logical lExpression, ;
         value byte    bNumberTrue, ;
         value byte    bNumberFalse

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

 Return
   A byte whose value depends on the result of conditional evaluation.

 Description
   The iifb() function evaluates lExpression and returns the byte 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

   // set color according to the Num Lock key's status
   
   proc Test_iifb
   clear
   cursor( .f. )
   ? "Press the Num Lock key or Esc to finish"
   do while .not. inkey() == K_ESC
      __syscolor[ CLR_STD ] := iifb( numkey(), BLACK_LIGHT_RED, BLACK_WHITE )
      @ 0, 70 ?? "Num"
   enddo
   endproc

   proc main
   Test_iifb()
   endproc

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

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