[fpc-pascal]sizeof returns wrong size?
senbei at terra.es
Wed Mar 27 23:22:58 CET 2002
>> if you finish the array with a null value you can know when is finish and so the length
>> of it. but as jonas said it'll be better to pass an argument to the function with the length
>> of the buffer:
>> Procedure Win32Write (Col,Row : byte; "length :dword;" var SourceData);
>Getting the length before calling the procedure was a PITA for the most part -- and sizeof still >didn't return the correct values even, when used on the calling side of the code -- but the logic >behind these two suggestions made a lot of sense. After some recoding I was able to get things >to function a bit better. Thanks.
Maybe if you post the type declaration of the SourceData you use, we can be able to find a solution.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal