diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 84b2670b4a..5841f1b662 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,25 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-08-22 22:51 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * utils/hbtest/rt_array.prg + + Added failing test case of doing AEval() + and resizing the evaluated array in the + eval codeblock. + + * utils/hbdoc/ft_funcs.prg + * utils/hbdoc/hbdoc.prg + * utils/hbmake/ft_funcs.prg + * utils/hbmake/hbmutils.prg + ! Two EOL handling fixes applied. + Thanks to Bill Robertson. + ; Please test. + + * contrib/xhb/Makefile + * contrib/xhb/common.mak + + contrib/xhb/arrayblk.prg + + Added HB_ARRAYBLOCK() + 2008-08-22 17:03 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/make_gcc_all.sh + Added darwin autodetection. diff --git a/harbour/contrib/xhb/Makefile b/harbour/contrib/xhb/Makefile index daa7a05507..fdc76aad7d 100644 --- a/harbour/contrib/xhb/Makefile +++ b/harbour/contrib/xhb/Makefile @@ -23,6 +23,7 @@ C_HEADERS=\ hbcompat.h \ PRG_SOURCES=\ + arrayblk.prg \ txml.prg \ hblog.prg \ hblognet.prg \ diff --git a/harbour/contrib/xhb/arrayblk.prg b/harbour/contrib/xhb/arrayblk.prg new file mode 100644 index 0000000000..9d2a6cad7e --- /dev/null +++ b/harbour/contrib/xhb/arrayblk.prg @@ -0,0 +1,57 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * HB_ArrayBlk function + * + * Copyright 2003 Walter Negro + * www - http://www.xharbour.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. + * + */ + + +FUNCTION HB_ARRAYBLOCK( aArray, nIndex ) + + RETURN {| x | iif( PCount() == 0, aArray[ nIndex ], aArray[ nIndex ] := x )} + diff --git a/harbour/contrib/xhb/common.mak b/harbour/contrib/xhb/common.mak index 102be30582..c130f131c4 100644 --- a/harbour/contrib/xhb/common.mak +++ b/harbour/contrib/xhb/common.mak @@ -28,6 +28,7 @@ LIB_OBJS = \ $(OBJ_DIR)hbcomprs$(OBJEXT) \ $(OBJ_DIR)xstrdel$(OBJEXT) \ \ + $(OBJ_DIR)arrayblk$(OBJEXT) \ $(OBJ_DIR)txml$(OBJEXT) \ $(OBJ_DIR)hblog$(OBJEXT) \ $(OBJ_DIR)hblognet$(OBJEXT) \ diff --git a/harbour/utils/hbdoc/ft_funcs.prg b/harbour/utils/hbdoc/ft_funcs.prg index 2f08cc232b..5fb76cd973 100644 --- a/harbour/utils/hbdoc/ft_funcs.prg +++ b/harbour/utils/hbdoc/ft_funcs.prg @@ -907,9 +907,6 @@ FUNCTION FT_FEOF() FUNCTION FReadLn() RETURN s_oFileBase:retrieve() -FUNCTION FT_FReadLn() - RETURN StrTran( FReadLn(), Chr( 13 ), "" ) - PROCEDURE FT_FGotop() s_oFileBase:Gotop() RETURN @@ -983,7 +980,7 @@ FUNCTION FREADline( nH, cB, nMaxLine ) cB := cLine ELSE cB := SUBSTR( cLine, 1, nEol - 1 ) - FSEEK( nH, nSavePos + nEol + 1, FS_SET ) + FSEEK( nH, nSavePos + Len( hb_OSNewLine() ) - 1, FS_SET ) ENDIF RETURN nNumRead != 0 diff --git a/harbour/utils/hbdoc/hbdoc.prg b/harbour/utils/hbdoc/hbdoc.prg index 4563ad4f12..6c729669d6 100644 --- a/harbour/utils/hbdoc/hbdoc.prg +++ b/harbour/utils/hbdoc/hbdoc.prg @@ -1562,7 +1562,7 @@ FUNCTION ReadLN( leof ) LOCAL cBuffer := "" - cBuffer := FT_FREADLN() + cBuffer := FReadLn() FT_FSKIP( 1 ) lEof := FT_FEOF() diff --git a/harbour/utils/hbmake/ft_funcs.prg b/harbour/utils/hbmake/ft_funcs.prg index 2f08cc232b..5fb76cd973 100644 --- a/harbour/utils/hbmake/ft_funcs.prg +++ b/harbour/utils/hbmake/ft_funcs.prg @@ -907,9 +907,6 @@ FUNCTION FT_FEOF() FUNCTION FReadLn() RETURN s_oFileBase:retrieve() -FUNCTION FT_FReadLn() - RETURN StrTran( FReadLn(), Chr( 13 ), "" ) - PROCEDURE FT_FGotop() s_oFileBase:Gotop() RETURN @@ -983,7 +980,7 @@ FUNCTION FREADline( nH, cB, nMaxLine ) cB := cLine ELSE cB := SUBSTR( cLine, 1, nEol - 1 ) - FSEEK( nH, nSavePos + nEol + 1, FS_SET ) + FSEEK( nH, nSavePos + Len( hb_OSNewLine() ) - 1, FS_SET ) ENDIF RETURN nNumRead != 0 diff --git a/harbour/utils/hbmake/hbmutils.prg b/harbour/utils/hbmake/hbmutils.prg index fde4f0d4b9..072771f10a 100644 --- a/harbour/utils/hbmake/hbmutils.prg +++ b/harbour/utils/hbmake/hbmutils.prg @@ -502,7 +502,7 @@ FUNCTION ReadLN( lEof ) *---------------------- LOCAL cBuffer := "" - cBuffer := FT_FREADLN() + cBuffer := FReadLn() cBuffer := STRTRAN( cBuffer, CHR( 13 ), "" ) cBuffer := STRTRAN( cBuffer, CHR( 10 ), "" ) FT_FSKIP( 1 ) diff --git a/harbour/utils/hbtest/rt_array.prg b/harbour/utils/hbtest/rt_array.prg index 659626e089..56975ae447 100644 --- a/harbour/utils/hbtest/rt_array.prg +++ b/harbour/utils/hbtest/rt_array.prg @@ -359,8 +359,20 @@ PROCEDURE Main_ARRAY() TEST_LINE( AScan( saAllTypes, scStringZ ) , 3 ) SET EXACT OFF + TEST_LINE( TAEVSM() , "N10N 9N 8N 7N 6N 5N 4N 3N 2N 1 0" ) + RETURN +STATIC FUNCTION TAEVSM() + + LOCAL cString := "" + LOCAL aArray := Array( 10 ) + + AFill( aArray, 0 ) + AEval( aArray, {| x | cString += ValType( x ) + Str( Len( aArray ), 2 ), ASize( aArray, Len( aArray ) - 1 ) } ) + + RETURN cString + Str( Len( aArray ) ) + STATIC FUNCTION TANew( cChar, nLen ) LOCAL aArray LOCAL tmp