2011-10-18 12 views
0

ドキュメントは、これがバイトの配列を返す関数の構文であることを暗示しています。私は間違って何をしていますか?Free Pascalと配列型の問題

$ fpc ios7crypt.pas 
ios7crypt.pas(3,25) Error: Type identifier expected 
ios7crypt.pas(3,25) Fatal: Syntax error, ";" expected but "ARRAY" found 
Fatal: Compilation aborted 

ios7crypt.pas:私のために

program IOS7Crypt; 

function XlatPrime() : array of byte; 
begin 
    XlatPrime := (
     $64, $73, $66, $64, $3b, $6b, $66, $6f, 
     $41, $2c, $2e, $69, $79, $65, $77, $72, 
     $6b, $6c, $64, $4a, $4b, $44, $48, $53, 
     $55, $42, $73, $67, $76, $63, $61, $36, 
     $39, $38, $33, $34, $6e, $63, $78, $76, 
     $39, $38, $37, $33, $32, $35, $34, $6b, 
     $3b, $66, $67, $38, $37 
    ); 
end; 

function Encrypt (hash : string) : string; 
begin 
    Encrypt := 'abc'; 
end; 

function Decrypt (hash : string) : string; 
begin 
    Decrypt := 'abc'; 
end; 

var 
    password : string; 
    hash : string; 
begin 
    password := 'abc'; 

    hash := Encrypt(password); 

    password := Decrypt(hash); 

    write('Password: '); 
    writeln(password); 
end. 

答えて

1

作品:

const 
    XlatSize = 53; 
    XlatPrime : array[0 .. XlatSize - 1] of byte = (
     $64, $73, $66, $64, $3b, $6b, $66, $6f, 
     $41, $2c, $2e, $69, $79, $65, $77, $72, 
     $6b, $6c, $64, $4a, $4b, $44, $48, $53, 
     $55, $42, $73, $67, $76, $63, $61, $36, 
     $39, $38, $33, $34, $6e, $63, $78, $76, 
     $39, $38, $37, $33, $32, $35, $34, $6b, 
     $3b, $66, $67, $38, $37 
    );