IBAN: Difference between revisions
→Free Pascal: move upCase to entrypoint function, demonstrate strUtils.delSpace function use
(insert →Free Pascal) |
(→Free Pascal: move upCase to entrypoint function, demonstrate strUtils.delSpace function use) |
||
Line 2,050:
=={{header|Free Pascal}}==
{{libheader|GMP}}
<lang Delphi>{$mode objFPC}
uses
// for delSpace function
strUtils,
// GNU multiple-precision library
GMP;
Line 2,071 ⟶ 2,072:
\return \param sample constains less than the most detectable errors
}
function isLegal(
function checksumCorrect(sample: IBANRepresentation): Boolean;
type
Line 2,091 ⟶ 2,092:
if not (sequence[i] in ['0'..'9']) then
begin
writeStr(transliteration, ord
end;
Line 2,113 ⟶ 2,114:
end;
begin
sample := upCase(sample);
{$push}
// just for emphasis: by default the FPC performs lazy evaluation
Line 2,126 ⟶ 2,128:
IBANLengthInCountry['G', 'B'] := 22;
// note, strings longer than 34 characters will be silently clipped
writeLn(isLegal(delSpace('GB82 WEST 1234 5698 7654 32')));
end.</lang>
{{out}}
<pre>TRUE</pre>
=={{header|Go}}==
|