[fpc-pascal] unit system; procedure move();
fpc at xgelb.de
fpc at xgelb.de
Mon Mar 17 12:34:29 CET 2008
Hi
I need more informations about the move() procedure form unit system.
I want to shift an array (values:array[0..Maximum-1] of single) like the
following lines:
for i:=Maximum-1 downto 1 do values[i]:=values[i-1];
values[0]:=sameothervalue;
I found the move procedure (unit system) and wrote this lines:
move(values[0],values[1],Maximum*sizeof(single));
values[0]:=sameothervalue;
I would use the move procedure, because the move procedure is very quickly.
The program runs very well with move, but I would avoid access violations in
future. That are the reasons of my questions:
Is the use of the move procedure right? The array length is Maximum-1. When I
put this length on value[1], the last entry value[Maximum-1] would be deleted
or would be shifted in an different memory area? What happens with the last
entry value[Maximum-1]?
Thank you.
Regards,
Markus
--
FreePascal Mailing List:
fpc-pascal at lists.freepascal.org
More information about the fpc-pascal
mailing list