I have problems saving the array to a file:
Var
Form1: TForm1;
S_arr: array [0..15] of byte;
D_arr: array of byte;
Procedure TForm1.Button1Click (Sender: TObject);
Var i: integer;
F: file of byte;
Fn: string;
Size: int64;
D_lock_arr: array of byte;
Begin
Setlength (d_arr, 16);
Setlength (d_lock_arr, 16);
For i: = 0 to 15 do begin
S_arr : = $ A5;
D_arr : = $ A5;
End;
//
Size: = length (s_arr);
Fn: = GetCurrentDir + '\ s.bin';
Assignfile (f, fn);
Rewrite (f, 1);
Blockwrite (f, s_arr, size);
Closefile (f);
//
Size: = length (d_arr);
Fn: = GetCurrentDir + '\ d.bin';
Assignfile (f, fn);
Rewrite (f, 1);
Blockwrite (f, d_arr, size);
Closefile (f);
//
Size: = length (d_lock_arr);
Fn: = GetCurrentDir + '\ d_loc.bin';
Assignfile (f, fn);
Rewrite (f, 1);
Blockwrite (f, d_lock_arr, size);
Closefile (f);
End;
Result: three different files