2
I have the following digitized line of a billet, I need a function to extract the expiration date from it, and then use in other.
Type line: 74893.12004.21627.007186.37931.981056 1 59490000041480
I know that the 5949
is the billet’s maturity, but I can’t convert to a Date. I mounted the following function but it didn’t work:
function ExtrairDataVencimento(const CodigoBarras: String): TDateTime;
begin
Result := StrToDate('07/10/1997') + StrToInt(Copy(CodigoBarras, 34, 4));
WriteLn(Result);
end;
Any suggestions?
Just for the record - digit line format:
bbbmL.LLLLLd LLLLL.LLLLLd LLLLL.LLLLLd D FFFFVVVVVVVVVV
, beingb
=bank /m
=currency (9=real) /L
="Freefield" /d
=Block checker digit /D
=Digit line checker /F
= Maturity Factor (days based on 7 October 1997) /V
= Value * 100. - The "Free Field" has data such as agreement number, agency, or other parameters, and varies from database to database.– Bacco