Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
function IsNumericString(const inStr: string): Boolean;
|
||||
var
|
||||
i: extended;
|
||||
begin
|
||||
Result := TryStrToFloat(inStr,i);
|
||||
end;
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
program isNumeric;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses
|
||||
Classes,
|
||||
SysUtils;
|
||||
|
||||
function IsNumericString(const inStr: string): Boolean;
|
||||
var
|
||||
i: extended;
|
||||
begin
|
||||
Result := TryStrToFloat(inStr,i);
|
||||
end;
|
||||
|
||||
|
||||
{ Test function }
|
||||
var
|
||||
s: string;
|
||||
c: Integer;
|
||||
|
||||
const
|
||||
MAX_TRIES = 10;
|
||||
sPROMPT = 'Enter a string (or type "quit" to exit):';
|
||||
sIS = ' is numeric';
|
||||
sISNOT = ' is NOT numeric';
|
||||
|
||||
begin
|
||||
c := 0;
|
||||
s := '';
|
||||
repeat
|
||||
Inc(c);
|
||||
Writeln(sPROMPT);
|
||||
Readln(s);
|
||||
if (s <> '') then
|
||||
begin
|
||||
tmp.Add(s);
|
||||
if IsNumericString(s) then
|
||||
begin
|
||||
Writeln(s+sIS);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Writeln(s+sISNOT);
|
||||
end;
|
||||
Writeln('');
|
||||
end;
|
||||
until
|
||||
(c >= MAX_TRIES) or (LowerCase(s) = 'quit');
|
||||
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue