@mas steindorff:
... but have you tried it on one that has changed 10 to 20 times with different lengths? ...
I use it everywhere in my code inside functions, methods, and loops of every flavor, and with ever changing string lengths and never had a single problem. It also works fine with dynamic arrays.
(your code in the other thread look like you used setlength() to fix it's size and thus it's location)
I use it the same way as I used FillByte:
FillerByte(variable, SizeOf(variable), 0);
I even have a code template for it:
[filleb0 | FillerByte(x, SizeOf(x), 0);]
$(AttributesStart)
EnableMakros=true
$(AttributesEnd)
FillerByte($param(variable), SizeOf($param(variable,sync=1)), |0);
thank you for this tidbit. if I read this correctly, that thread says you are using fillchar on strings? from what I understand, a string may be broken across 2 areas of memory and is likely to live outside it's record's memory block. I can see how it may work on a string at startup or if it's fixed size but have you tried it on one that has changed 10 to 20 times with different lengths? (your code in the other thread look like you used setlength() to fix it's size and thus it's location)
I think the assign count is cleaned safely because
x is an
out parameter. Then the FillByte works as it where the first time cleaning that record.
If you think it is possible to fail in some circumstances, then it would be a good idea to do a test to confirm if it behaves correctly or not.