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
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal