protected bool IsFloatValue( out float val, out int length )
{
bool valueFound = false;
int currPos = charPos;
string floatString = "";
bool firstNonSpace = false;
char c = source[ currPos ];
// have the out param at least set to 0
val = 0.0f;
length = 0;
while ( Char.IsNumber( c ) || c == '.' || c == '-' || c == ' ' )
{
if ( c != ' ' && !firstNonSpace )
{
firstNonSpace = true;
}
if ( c == ' ' && firstNonSpace )
{
break;
}
else
{
length++;
}
floatString += c;
c = source[ ++currPos ];
}
if ( charPos != currPos )
{
val = StringConverter.ParseFloat( floatString );
valueFound = true;
}
return valueFound;
}