Ch := S[Inx];
{обработать в зависимости от состояния}
case State of
StartState : begin
if (Ch = '+') or (Ch = '-') then
State := GotSign else
if (Ch = DecimalSeparator) then
State := GotInitDecPt else
if TDIsdigit(Ch) then
State := GotInitDigit else
Exit;
end;
GotSign : begin
if (Ch = DecimalSeparator) then
State := GotInitDecPt else
if TDIsDigit(Ch) then
State := GotInitDigit else Expend;
GotInitDigit : begin
if (Ch = DecimalSeparator) then
State := ScanDigits else
if not TDIsDigit(Ch) then
Exit;
end;
GotInitDecPt : begin
if TDIsDigit(Ch) then
State := ScanDigits else Expend;
ScanDigits : begin
if not TDIsDigit (Ch) then
Exit;
end;