/* * $Id$ */ /* * Harbour Project source code: * Header file for Table,Record and Field Class * * Copyright 1999 {list of individual authors and e-mail addresses} * www - http://harbour-project.org * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). * * As a special exception, the Harbour Project gives permission for * additional uses of the text contained in its release of Harbour. * * The exception is that, if you link the Harbour libraries with other * files to produce an executable, this does not by itself cause the * resulting executable to be covered by the GNU General Public License. * Your use of that executable is in no way restricted on account of * linking the Harbour library code into it. * * This exception does not however invalidate any other reasons why * the executable file might be covered by the GNU General Public License. * * This exception applies only to the code released by the Harbour * Project under the name Harbour. If you copy code from other * Harbour Project or Free Software Foundation releases into a copy of * Harbour, as the General Public License permits, the exception does * not apply to the code that you add in this way. To avoid misleading * anyone as to the status of such modified files, you must delete * this exception notice from them. * * If you write modifications of your own for Harbour, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. * */ #ifndef _OTABLE_CH_ // --> Network messages #define _NET_USE_FAIL_MSG "Net Open Fail !!!" // --> ::dbMove() constants #define _DB_TOP -999999999999 #define _DB_BOTTOM -888888888888 #define _DB_BOF -777777777777 #define _DB_EOF -666666666666 #define NET_RECLOCK 1 #define NET_FILELOCK 2 #define NET_APPEND 3 #define NET_OPEN_MODE .T. #define EXCLUSIVE_OPEN_MODE .F. #define RETRY_MSG "NETWORK ERROR;Continue Attempt to Lock Record/File ?" #define YESNO_COLOR "R/W" #define MAX_TABLE_AREAS 680 #xcommand DEFAULT := ; [, := ] => ; := If( == nil, , ) ;; [ := If( == nil, , ); ] #xcommand DEFAULT TO [, TO ] ; => ; IF == NIL ; := ; END ; [; IF == NIL ; := ; END ] // --> OOPs #xtranslate BYNAME [, ] => :: := [; :: := ] #xtranslate BYNAME DEFAULT => :: := BYDEFAULT , #xtranslate BYDEFAULT , => if( == NIL, , ) #xCommand NETUSE <(cDBF)> ; [ALIAS ] ; [VIA ] ; [TIMER ] ; [] ; [] ; => ; netDbUse( <(cDBF)>, <(cAlias)>, , , ; <.new.>, NET_OPEN_MODE, <.ro.> ) // --> new table object #xCommand DEFINE TABLE ; [FILE ] ; [INDEX ] ; [ALIAS ] ; [VIA ] ; [PATH ] ; [] ; [] ; [] ; =>; := TableNew( ; <(cFileDBF)>, ; <"cAlias">, ; <(cFileIDX)>, ; <(cDriver)>, ; <.lshared.>, ; <(cPathDBF)>, ; <.lnew.>, ; <.lrdonly.> ) // --> new order object #xCommand DEFINE ORDER [] ; ON [KEY] ; [TAG ] ; [LABEL ] ; [FOR ] ; [WHILE ] ; [EVAL ] ; [EVERY ] ; [] ; [TO ]; IN ; =>; [:=] :AddOrder( ; <(cTag)>, ; <"key">, ; <(cLabel)>, ; <"for">, ; <"while">, ; [<.unique.>], ; <{eval}>, ; , ; <(cOrderFile)>; ) #xCommand ADD FIELD DATA [] TO ; => ; :ClassAdd( <"cFld">,, {|Self| [] },,) #xCommand DEFINE FIELD DATA [] TO ; => ; :ClassAdd( <"cFld">,, {|Self| [] },,) // --> ::undo() buffer constants #define _WRITE_BUFFER 1 #define _DELETE_BUFFER 2 #define _RECALL_BUFFER 3 #xCommand BEGIN TRANSACTION IN => :SetMonitor( .T. ) #xCommand ROLLBACK ; [STEP ] ; IN ; => ; :Undo( , [] ) #xCommand END TRANSACTION IN => :SetMonitor( .F. ) #command SKIP in => :dbSkip(1) #command SKIP in => :dbSkip( ) #command SEEK ; [] ; [] in ; => :dbSeek( , if( <.soft.>, .T., NIL ), if( <.last.>, .T., NIL ) ) #translate CSY_TYPE Character => "C" #xtranslate CSY_TYPE Numeric => "N" #xtranslate CSY_TYPE Date => "D" #xtranslate CSY_TYPE Memo => "M" #xtranslate CSY_TYPE Logical => "L" #xtranslate CSY_TYPE Auto => "A" #xcommand CREATE DATABASE FILE => :=HBTable():CreateTable(<(file)>);#define _TABLE_ #xTranslate FIELD [ ] ; [ NAME <(cName)> ] ; [ TYPE ] ; [ LEN ] ; [ DEC ] ; OF ; => ; [ := ] _TABLE_:AddField( <(cName)>,CSY_TYPE , , ) #xCommand BUILD TABLE => _TABLE_:Gentable() #define _OTABLE_CH_ #endif