2008-10-19 00:05 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* common.mak
  * include/hbextern.ch
  * source/rtl/Makefile
  + source/rtl/strtrim.c
    + Added function HB_N2S( <number> ) -> <string>.
      This is equivalent to LTrim( Str( <number> ) ), 
      just faster.

  * source/rtl/dircmd.prg
  * source/rtl/tget.prg
    * Minor cleanup.
This commit is contained in:
Viktor Szakats
2008-10-18 22:07:57 +00:00
parent f795ac92c9
commit 2ab83da8a1
7 changed files with 100 additions and 4 deletions

View File

@@ -8,6 +8,19 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-10-19 00:05 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* common.mak
* include/hbextern.ch
* source/rtl/Makefile
+ source/rtl/strtrim.c
+ Added function HB_N2S( <number> ) -> <string>.
This is equivalent to LTrim( Str( <number> ) ),
just faster.
* source/rtl/dircmd.prg
* source/rtl/tget.prg
* Minor cleanup.
2008-10-18 22:21 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbmysql/utils/bld_b32.bat
* contrib/hbmysql/utils/bld_vc.bat

View File

@@ -479,7 +479,7 @@ RTL_LIB_OBJS = \
$(OBJ_DIR)\dateshb$(OBJEXT) \
$(OBJ_DIR)\datesx$(OBJEXT) \
$(OBJ_DIR)\defpath$(OBJEXT) \
$(OBJ_DIR)\defpathu$(OBJEXT) \
$(OBJ_DIR)\defpathu$(OBJEXT) \
$(OBJ_DIR)\descend$(OBJEXT) \
$(OBJ_DIR)\dirdrive$(OBJEXT) \
$(OBJ_DIR)\direct$(OBJEXT) \
@@ -579,7 +579,7 @@ RTL_LIB_OBJS = \
$(OBJ_DIR)\setpos$(OBJEXT) \
$(OBJ_DIR)\setposbs$(OBJEXT) \
$(OBJ_DIR)\shadow$(OBJEXT) \
$(OBJ_DIR)\shadowu$(OBJEXT) \
$(OBJ_DIR)\shadowu$(OBJEXT) \
$(OBJ_DIR)\soundex$(OBJEXT) \
$(OBJ_DIR)\space$(OBJEXT) \
$(OBJ_DIR)\spfiles$(OBJEXT) \
@@ -588,6 +588,7 @@ RTL_LIB_OBJS = \
$(OBJ_DIR)\strcase$(OBJEXT) \
$(OBJ_DIR)\strmatch$(OBJEXT) \
$(OBJ_DIR)\strtran$(OBJEXT) \
$(OBJ_DIR)\strtrim$(OBJEXT) \
$(OBJ_DIR)\strzero$(OBJEXT) \
$(OBJ_DIR)\stuff$(OBJEXT) \
$(OBJ_DIR)\substr$(OBJEXT) \

View File

@@ -1118,6 +1118,7 @@ EXTERNAL HB_TOKENPTR
EXTERNAL HB_ATOKENS
EXTERNAL HB_STRSHRINK
EXTERNAL HB_MEMOWRIT
EXTERNAL HB_N2S
EXTERNAL HB_HASH
EXTERNAL HB_HHASKEY

View File

@@ -130,6 +130,7 @@ C_SOURCES=\
strmatch.c \
strpeek.c \
strtran.c \
strtrim.c \
strzero.c \
stuff.c \
substr.c \

View File

@@ -94,7 +94,7 @@ STATIC PROCEDURE PutDBF( aDirEntry )
LOCAL fhnd
LOCAL buffer
LOCAL nRecCount := 0
LOCAL dLastUpdate := hb_SToD( "" )
LOCAL dLastUpdate := hb_SToD()
IF ( fhnd := FOpen( aDirEntry[ F_NAME ] ) ) != F_ERROR

View File

@@ -0,0 +1,80 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* HB_N2S() function
*
* Copyright 2008 Viktor Szakats <harbour.01 syenar.hu>
* 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, 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.
*
*/
#include "hbapi.h"
#include "hbapiitm.h"
HB_FUNC( HB_N2S )
{
PHB_ITEM pNumber = hb_param( 1, HB_IT_NUMERIC );
if( pNumber )
{
char * szResult = hb_itemStr( pNumber, NULL, NULL );
if( szResult )
{
ULONG nToTrim = 0;
while( szResult[ nToTrim ] == ' ' )
++nToTrim;
if( nToTrim )
memmove( szResult, szResult + nToTrim, strlen( szResult + nToTrim ) + 1 );
hb_retc_buffer( szResult );
return;
}
}
hb_retc_null();
}

View File

@@ -1441,7 +1441,7 @@ METHOD badDate() CLASS Get
RETURN ::hasFocus .AND. ;
::type == "D" .AND. ;
( xValue := ::unTransform() ) == hb_SToD( "" ) .AND. ;
( xValue := ::unTransform() ) == hb_SToD() .AND. ;
!( ::cBuffer == Transform( xValue, ::cPicture ) )
#ifdef HB_C52_UNDOC