Files
harbour-core/contrib/hbgt/strasint.c
Viktor Szakats cfb1dfd8fa 2013-04-08 00:52 UTC+0200 Viktor Szakats (harbour syenar.net)
* bin/check.hb
    + will now check for missing copyright/license message
      in source files (except for tests and files shorter
      than 20 lines)

  * contrib/hbamf/amf.h
  * contrib/hbamf/amfstdio.c
  * contrib/hbamf/hbamfobj.prg
  * contrib/hbamf/hbcls.c
  * contrib/hbgt/strasint.c
  * contrib/hbhttpd/core.prg
  * contrib/hbhttpd/widgets.prg
  * contrib/hbmisc/hbedit.prg
  * contrib/hbmisc/hbeditc.c
  * contrib/hbmisc/stringsx.c
  * contrib/hbmisc/udpds.prg
  * contrib/hbnf/aredit.prg
  * contrib/hbnf/easter.prg
  * contrib/hbnf/mouse1.prg
  * contrib/xhb/hbsyslog.c
  * extras/guestbk/_cgi.prg
  * extras/guestbk/_inifile.prg
  * extras/guestbk/cgi.ch
  * extras/hbdroid/hvminit.c
  * extras/hbdroid/msginfo.c
  * extras/hbusb/core.c
  * extras/hbvpdf/hbvpdf.ch
    + added copyright/license headers where missing

  * tests/inifiles.prg
    + synced with another copy

  * include/hbclass.ch
  * src/compiler/expropta.c
  * src/compiler/exproptb.c
  * src/macro/macroa.c
  * src/macro/macrob.c
    * minor cleanup
2013-04-08 00:53:37 +02:00

32 lines
794 B
C

/***
* Function: _GT_Internal_StringAsInt()
* Syntax..: int _GT_Internal_StringAsInt(char *String, int Start, int End)
* Usage...: Convert a numeric value in a string to an int value.
* By......: David A Pearson
*
* This is an original work by David A Pearson and is placed in the
* public domain.
*/
#include "hbapi.h"
int _GT_Internal_StringAsInt( char * String, HB_ISIZ Start, HB_ISIZ End )
{
int Decimal = 1;
int Value = 0;
HB_ISIZ Digit;
HB_TRACE( HB_TR_DEBUG, ( "_GT_Internal_StringAsInt(%s, %" HB_PFS "d, %" HB_PFS "d)", String, Start, End ) );
for( Digit = End; Digit >= Start; Digit-- )
{
if( HB_ISDIGIT( String[ Digit ] ) )
{
Value += ( String[ Digit ] - '0' ) * Decimal;
Decimal *= 10;
}
}
return Value;
}