วันจันทร์ที่ 30 มกราคม พ.ศ. 2555

delphi วิธีตรวจสอบค่าที่พิมพ์ว่าเป็นตัวเลข

function IsStrANumber(const S: string): Boolean;
var
P: PChar;
begin
P := PChar(S);
Result := False;
while P^ <> #0 do
begin
if not (P^ in ['0'..'9']) then Exit;
Inc(P);
end;
Result := True;
end;

ไม่มีความคิดเห็น:

แสดงความคิดเห็น