Guest_imported
New member
- Jan 1, 1970
- 0
Hi Guys,
Im trying to write a routine to load a file into a dynamic byte array.
the code looks something like this
var buf:array of byte;
var fh:file;
var x:integer;
begin
x:=256; {this value is actually random}
resizee(buf,x);
assignfile(fh,1);
blockread(fh,buf,x)
{close file stuff here}
end;
It keeps erroring, sometimes, it crashes my whole system?.
Am i going about it all wrong?
If i declare the array as fixed size instead of dynamic it works fine but I need to be able to resize.
Please Help,
Jamie Fuller
Im trying to write a routine to load a file into a dynamic byte array.
the code looks something like this
var buf:array of byte;
var fh:file;
var x:integer;
begin
x:=256; {this value is actually random}
resizee(buf,x);
assignfile(fh,1);
blockread(fh,buf,x)
{close file stuff here}
end;
It keeps erroring, sometimes, it crashes my whole system?.
Am i going about it all wrong?
If i declare the array as fixed size instead of dynamic it works fine but I need to be able to resize.
Please Help,
Jamie Fuller