Created
October 3, 2021 14:22
-
-
Save FrBrGeorge/d6c84f8ffa50b178a85d610d5a23d23f to your computer and use it in GitHub Desktop.
Revisions
-
FrBrGeorge created this gist
Oct 3, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ procedure Check(d: string; var res: boolean; var hms: vec); var i, r: integer; begin res := length(d) = 8; if not res then exit; res := (d[3] = ':') AND (d[6] = ':'); if not res then exit; for i:=1 to 3 do begin val(copy(d, 1+(i-1)*3, 2), hms[i], r); res := r = 0; if not res then exit; end; res := (hms[1] <= 24) AND (hms[2] <= 60) and (hms[3] <= 60); end;