* contrib/hbgt/tests/test.prg
* formatting (manual)
* contrib/hbct/bitnum.c
* contrib/hbct/charmirr.c
* contrib/hbct/charonly.c
* contrib/hbct/charsort.c
* contrib/hbct/ctpad.c
* contrib/hbct/ctstr.c
* contrib/hbct/envparam.c
* contrib/hbct/expand.c
* contrib/hbct/files.c
* contrib/hbct/justify.c
* contrib/hbct/misc2.c
* contrib/hbct/numat.c
* contrib/hbct/pos1.c
* contrib/hbct/posdiff.c
* contrib/hbct/relation.c
* contrib/hbct/replace.c
* contrib/hbct/strswap.c
* contrib/hbct/token1.c
* contrib/hbct/token2.c
* minor whitespace formatting
* contrib/hbgt/ascposgt.c
* contrib/hbgt/atdiff.c
* contrib/hbgt/bitflags.c
* contrib/hbgt/chareven.c
* contrib/hbgt/charmixg.c
* contrib/hbgt/charodd.c
* contrib/hbgt/chrcount.c
* contrib/hbgt/chrfirst.c
* contrib/hbgt/chrtotal.c
* contrib/hbgt/strasint.c
* contrib/hbgt/strcount.c
* contrib/hbgt/strcspn.c
* contrib/hbgt/strdiffg.c
* contrib/hbgt/strexpan.c
* contrib/hbgt/strleft.c
* contrib/hbgt/strpbrk.c
* contrib/hbgt/strright.c
* reformatted using uncrustify
32 lines
977 B
C
32 lines
977 B
C
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*****************************************************************************
|
|
* 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 *
|
|
*****************************************************************************/
|
|
|
|
#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 ] - 0x30 ) * Decimal;
|
|
Decimal *= 0xA;
|
|
}
|
|
}
|
|
return Value;
|
|
}
|