[fpc-pascal] Compiler raise an EAbort exception

ik idokan at gmail.com
Sat Apr 4 15:07:58 CEST 2009


Hello,

I'm using FPC from Arch Liunx.

I'm trying to do the following code:

...
TNumberValidationRecord = record
                              Name                : String;
                              CreditType          : CreditCardType;
                              Prefix              : TCreditCardPrefix;
                              NumberLength        : TCredtCardLength;
                              Validation          : TCreditCardValidation;
                            end;
...

function PupolateRecord(aName       : String;                aCreditType   :
CreditCardType;
                        aPrefix     : Array of word;         aNumberLength :
Array of Word;
                        aValidation :
TCreditCardValidation                                    ) :
TNumberValidationRecord;
var
  i               : integer;
begin
  with Result do
    begin
     Name         := aName;
     CreditType   := aCreditType;
     SetLength(Prefix, High(aPrefix));
     SetLength(NumberLength, High(aNumberLength));
     for i := Low(aPrefix)       to High(aPrefix)       do Prefix[i]
:= aPrefix[i];
     for i := Low(aNumberLength) to High(aNumberLength) do NumberLength[i]
:= aNumberLength[i];
     validation   := aValidation;
    end;
end;

When I try to do the following:

RegisterCreditCard(PupolateRecord('MasterCard', cctMasterCard, [51..55],
[16], @validate));

The compiler crash with the following exception:

ppcx64 creditcard_validty.pp -Fu../luhn/
Free Pascal Compiler version 2.2.5 [2009/03/17] for
x86_64
Copyright (c) 1993-2008 by Florian
Klaempfl
Target OS: Linux for
x86-64
Compiling
creditcard_validty.pp

Fatal: Compilation
aborted
An unhandled exception occurred at $00000000005591E2
:
EAbstractError : Abstract method
called

$00000000005591E2


$00000000005591E2


$000000000057C968


$000000000057C968


$000000000057C968


$000000000057C968


$000000000057DF64


$00000000005591E2


$000000000057DF64


$00000000005591E2

  $00000000005591E2
  $00000000005591E2
  $00000000005591E2
  $000000000052D9B6
  $000000000052DDDB
  $000000000052A1C1
  $000000000052D205

Am I doing here something wrong (I think I can do better with coping between
open and dynamic array) ?

Thanks,

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20090404/d68d57a7/attachment.html>


More information about the fpc-pascal mailing list