delphi - How to change length of dynamic arrays as 'out' parameters? -
I wrote a function, which separates two or more packets obtained in a physical packet. However, the compiler does not appreciate my efforts. Each packet size is in the first two bytes of the packet header, which is 6 bytes. So a real packet = this is the first two bytes + 6. I think if there are more than one packet. >
process different packets (packet: indicator; size: word; out result: indicator's out; out number: byte); Var Status: Byte; // Status Start Position: = 0; Number: = 0; SetLength (Results, 0); // & lt; & Lt; Error (podord (cardinal (+ packet + status) ^ + 6 first two bytes + 6 (packet header) satellabamba (result, length (result) + 1); // Ink length & lt; & Lt; Error result [number]: = cardinal (packet) + position; Status: = results [number] + padord (cardinal (packet) + position) ^ + 6; Inc (number); End; End;
I have collected compile-time errors in '& lt; & Lt; Error '. The error is one - 'Incompatible type'
I never know the number of packets received in a physical packet, so if the number increases then I want to increase the length of the array.
How do I solve my errors?
How about creating a new type? I think this should work.
type TPntArray = Pointer array;
Comments
Post a Comment