I am writing a wrapper to communicate with an external binary API. The API uses PDUs (Packed Binary Entries) for communication. Strings are AnsiChar arrays and end with zero:
type TSomePDU = packed record //... StringField: array[0..XYZ] of AnsiChar; //... end; PSomePDU = ^TSomePDU;
I want to write a FillPDUString procedure that will take a String and fill the char array, but I want to avoid MaxLength tracking wherever this procedure is used, so I need to somehow get the size of the declared array taking into account the pointer to the field:
function GetMaxSize(const Field: array of AnsiChar): Integer; begin
Is it possible?
source share