home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / harbb30g.zip / INCLUDE / common.ch < prev    next >
Text File  |  1999-09-15  |  3KB  |  65 lines

  1. /*
  2.  * $Id: common.ch,v 1.2 1999/09/15 14:03:36 vszel Exp $
  3.  */
  4.  
  5. /*
  6.  * Harbour Project source code:
  7.  * Header file for common macros
  8.  *
  9.  * Copyright 1999 {list of individual authors and e-mail addresses}
  10.  * www - http://www.harbour-project.org
  11.  *
  12.  * This program is free software; you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation; either version 2 of the License, or
  15.  * (at your option) any later version, with one exception:
  16.  *
  17.  * The exception is that if you link the Harbour Runtime Library (HRL)
  18.  * and/or the Harbour Virtual Machine (HVM) with other files to produce
  19.  * an executable, this does not by itself cause the resulting executable
  20.  * to be covered by the GNU General Public License. Your use of that
  21.  * executable is in no way restricted on account of linking the HRL
  22.  * and/or HVM code into it.
  23.  *
  24.  * This program is distributed in the hope that it will be useful,
  25.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27.  * GNU General Public License for more details.
  28.  *
  29.  * You should have received a copy of the GNU General Public License
  30.  * along with this program; if not, write to the Free Software
  31.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
  32.  * their web site at http://www.gnu.org/).
  33.  *
  34.  */
  35.  
  36. #ifndef _COMMON_CH
  37. #define _COMMON_CH
  38.  
  39. /* Friendly logical aliases */
  40. #define TRUE                    .T.
  41. #define FALSE                   .F.
  42. #define YES                     .T.
  43. #define NO                      .F.
  44.  
  45. /* Type checking macros */
  46. #translate ISNIL( <xValue> )    => ( <xValue> == NIL )
  47. #translate ISARRAY( <xValue> )  => ( ValType( <xValue> ) == "A" )
  48. #translate ISBLOCK( <xValue> )  => ( ValType( <xValue> ) == "B" )
  49. #translate ISCHAR( <xValue> )   => ( ValType( <xValue> ) == "C" )
  50. #translate ISDATE( <xValue> )   => ( ValType( <xValue> ) == "D" )
  51. #translate ISLOG( <xValue> )    => ( ValType( <xValue> ) == "L" )
  52. #translate ISMEMO( <xValue> )   => ( ValType( <xValue> ) == "M" )
  53. #translate ISNUM( <xValue> )    => ( ValType( <xValue> ) == "N" )
  54. #translate ISOBJECT( <xValue> ) => ( ValType( <xValue> ) == "O" )
  55.  
  56. /* DEFAULT and UPDATE commands */
  57. #xcommand DEFAULT <v1> TO <x1> [, <vn> TO <xn> ] => ;
  58.                                 IF <v1> == NIL ; <v1> := <x1> ; END ;
  59.                                 [; IF <vn> == NIL ; <vn> := <xn> ; END ]
  60.  
  61. #command UPDATE <v1> IF <exp> TO <v2> => ;
  62.                                 IF <exp> ; <v1> := <v2> ; END
  63.  
  64. #endif /* _COMMON_CH */
  65.