home *** CD-ROM | disk | FTP | other *** search
- unit Str2InU;
-
- interface
- function Str2Int(X: string; var Err: integer): integer;
-
- implementation
-
- function Str2Int;
- var Continue: boolean;
- I,
- N: integer;
- begin
- Continue := true;
- for I := ord(x[0]) downto 1 do
- if not (X[I] in ['0'..'9','.','-']) then
- delete(X,I,1);
- N := 0;
- if ord(x[0]) < 1 then
- Err := -1
- else
- val(X,N,Err);
- Str2Int := N;
- end;
-
- end.
-