Fungsi untuk mengecek apakah suatu entry data string mempunyai format
Floating Point atau bukan
function
IsStrFloatNum(s: string): Boolean;
begin
try
StrToFloat(s);
Result := True;
except
Result := False;
end;
end;
begin
try
StrToFloat(s);
Result := True;
except
Result := False;
end;
end;
Contoh penggunaan
If IsStrFloatNum(Edit1.text ) =
true then ShowMessage(‘Data Adalah Floating Point’)
Else ShowMessage(‘Data Bukan Floating Point’);
No comments:
Post a Comment