<div dir="ltr">Hello,<br><br>I'm using FPC from Arch Liunx.<br><br>I'm trying to do the following code:<br><br>...<br>TNumberValidationRecord = record<br> Name : String;<br>
CreditType : CreditCardType;<br> Prefix : TCreditCardPrefix;<br> NumberLength : TCredtCardLength;<br> Validation : TCreditCardValidation;<br>
end;<br>...<br><br>function PupolateRecord(aName : String; aCreditType : CreditCardType;<br> aPrefix : Array of word; aNumberLength : Array of Word;<br>
aValidation : TCreditCardValidation ) : TNumberValidationRecord;<br>var<br> i : integer;<br>begin<br> with Result do<br> begin<br> Name := aName;<br>
CreditType := aCreditType;<br> SetLength(Prefix, High(aPrefix));<br> SetLength(NumberLength, High(aNumberLength));<br> for i := Low(aPrefix) to High(aPrefix) do Prefix[i] := aPrefix[i];<br>
for i := Low(aNumberLength) to High(aNumberLength) do NumberLength[i] := aNumberLength[i];<br> validation := aValidation;<br> end;<br>end;<br><br>When I try to do the following:<br><br>RegisterCreditCard(PupolateRecord('MasterCard', cctMasterCard, [51..55], [16], @validate));<br>
<br>The compiler crash with the following exception:<br><br>ppcx64 creditcard_validty.pp -Fu../luhn/<br>Free Pascal Compiler version 2.2.5 [2009/03/17] for x86_64 <br>Copyright (c) 1993-2008 by Florian Klaempfl <br>
Target OS: Linux for x86-64 <br>Compiling creditcard_validty.pp <br>Fatal: Compilation aborted <br>
An unhandled exception occurred at $00000000005591E2 : <br>EAbstractError : Abstract method called <br> $00000000005591E2 <br>
$00000000005591E2 <br> $000000000057C968 <br> $000000000057C968 <br>
$000000000057C968 <br> $000000000057C968 <br> $000000000057DF64 <br>
$00000000005591E2 <br> $000000000057DF64 <br> $00000000005591E2 <br>
$00000000005591E2<br> $00000000005591E2<br> $00000000005591E2<br> $000000000052D9B6<br> $000000000052DDDB<br> $000000000052A1C1<br> $000000000052D205<br><br>Am I doing here something wrong (I think I can do better with coping between open and dynamic array) ?<br>
<br>Thanks,<br><br>Ido<br>
</div>