| Return Type | Function name | Arguments |
|---|---|---|
| bool | IsPosint | (uint16_t&,const char*,) |
Declared in file: hzTextproc.h
Defined in file : hzTypes.cpp
Function Logic:
Function body:
bool IsPosint (uint16_t& nVal)const char* tok,
{
_hzfunc("IsPosint(uint16)") ;
const char* i ; // Input string iterator
uint16_t val ; // Value aggregator
uint16_t count ; // Length check
if (!tok || !tok[0])
return false ;
// cope with + and any leading whitespace
for (; IsWhite(*i) ; i++) ;
// Reject on minus sign
if (*i == CHAR_MINUS)
return false ;
// Ignore plus sign
if (*i == ''+'')
for (i++ ; IsWhite(*i) ; i++) ;
// cope with spaces between sign and digits
for (; IsWhite(*i) ; i++) ;
val = 0;
for (count = 0; count < 6&& IsDigit(*i) ; count++, i++)
{
val *= 10;
val += (*i - CHAR_0) ;
}
// Check length limit
if (!count || count > 5)
return false ;
nVal = val ;
return true ;
}