home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / or.c < prev    next >
C/C++ Source or Header  |  1993-10-14  |  1KB  |  62 lines

  1. /*
  2.  * File......: OR.C
  3.  * Author....: Dave Pearson
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Dave Pearson
  7.  * Date......: 30/03/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Dave Pearson and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20. // NOTE: This code has been written for and compiled with Borland C++
  21. //       Version 3.1
  22. //
  23.  
  24. #include <extend.h>
  25.  
  26. /*  $DOC$
  27.  *  $FUNCNAME$
  28.  *      GT_OR()
  29.  *  $CATEGORY$
  30.  *      Maths
  31.  *  $ONELINER$
  32.  *      Perform a bit-wise OR operation.
  33.  *  $SYNTAX$
  34.  *      GT_Or(<nNumber1>,<nNumber2>) --> nResult
  35.  *  $ARGUMENTS$
  36.  *      <nNumber1> and <nNumber2> are two numbers that you whish to
  37.  *      OR together.
  38.  *  $RETURNS$
  39.  *      The result of <nNumeric1> OR <nNumeric2>.
  40.  *  $DESCRIPTION$
  41.  *      GT_Or() can be used for any bit oriented masking operation. GT_Or()
  42.  *      is the functional equivlant of the OR instruction in assembler and
  43.  *      the | operator in C.
  44.  *  $EXAMPLES$
  45.  *      ? GT_Or(131,15)           // Print the value of 131 | 15.
  46.  *  $SEEALSO$
  47.  *      GT_AND() GT_XOR()
  48.  *  $END$
  49.  */
  50.  
  51. CLIPPER GT_Or()
  52. {
  53.         if (PCOUNT == 2 && ISNUM(1) && ISNUM(2))
  54.         {
  55.                 _retnl((long) _parnl(1) | (long) _parnl(2));
  56.         }
  57.         else
  58.         {
  59.                 _retnl(0L);
  60.         }
  61. }
  62.