19991018-07:36 GMT+1
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
19991018-07:36 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
+ source/rtl/afields.prg
|
||||
source/rtl/Makefile
|
||||
+ AFIELDS() function added (by Jose Lalin)
|
||||
WARNING ! Please add new file to non-GNU make systems.
|
||||
|
||||
19991018-00:03 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
* source/vm/hvm.c
|
||||
+ Support for overloading the following operators:
|
||||
|
||||
@@ -47,6 +47,7 @@ C_SOURCES=\
|
||||
PRG_SOURCES=\
|
||||
achoice.prg \
|
||||
adir.prg \
|
||||
afields.prg \
|
||||
alert.prg \
|
||||
asort.prg \
|
||||
browdb.prg \
|
||||
|
||||
79
harbour/source/rtl/afields.prg
Normal file
79
harbour/source/rtl/afields.prg
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* AFIELDS() function
|
||||
*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* www - http://www.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 of the License, or
|
||||
* (at your option) any later version, with one exception:
|
||||
*
|
||||
* The exception is that if you link the Harbour Runtime Library (HRL)
|
||||
* and/or the Harbour Virtual Machine (HVM) 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 HRL
|
||||
* and/or HVM code into it.
|
||||
*
|
||||
* 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
|
||||
* their web site at http://www.gnu.org/).
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dbstruct.ch"
|
||||
|
||||
FUNCTION AFields( aFieldNames, aTypes, aWidths, aDecimals )
|
||||
|
||||
LOCAL aStruct := dbStruct()
|
||||
LOCAL nLen := Len( aStruct )
|
||||
|
||||
IF nLen > 0
|
||||
|
||||
IF ISARRAY( aFieldNames )
|
||||
nLen := Min( nLen, Len( aFieldNames ) )
|
||||
ENDIF
|
||||
|
||||
IF ISARRAY( aTypes )
|
||||
nLen := Min( nLen, Len( aTypes ) )
|
||||
ENDIF
|
||||
|
||||
IF ISARRAY( aWidths )
|
||||
nLen := Min( nLen, Len( aWidths ) )
|
||||
ENDIF
|
||||
|
||||
IF ISARRAY( aDecimals )
|
||||
nLen := Min( nLen, Len( aDecimals ) )
|
||||
ENDIF
|
||||
|
||||
IF ISARRAY( aFieldNames )
|
||||
aEval( aStruct, {| aField, nIndex | aFieldNames[ nIndex ] := aField[ DBS_NAME ] }, 1, nLen )
|
||||
ENDIF
|
||||
|
||||
IF ISARRAY( aTypes )
|
||||
aEval( aStruct, {| aField, nIndex | aTypes[ nIndex ] := aField[ DBS_TYPE ] }, 1, nLen )
|
||||
ENDIF
|
||||
|
||||
IF ISARRAY( aWidths )
|
||||
aEval( aStruct, {| aField, nIndex | aWidths[ nIndex ] := aField[ DBS_LEN ] }, 1, nLen )
|
||||
ENDIF
|
||||
|
||||
IF ISARRAY( aDecimals )
|
||||
aEval( aStruct, {| aField, nIndex | aDecimals[ nIndex ] := aField[ DBS_DEC ] }, 1, nLen )
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
|
||||
RETURN nLen
|
||||
Reference in New Issue
Block a user