Adriaan van Os wrote:
(1) What about this: get a pointer to the first array element and then clear sizeof-array-element * array-size bytes ?
(2) With modern risc processors, the time delay for operations on large data sets is typically in memory stalls, not in processor instructions. Are your records densely packed or unaligned on the processor's "natural" data bounds ? Did you actually try to zero the array in a for loop per record (with a low-level routine if you want) ? Did you profile the software ?
Thanks Adriaan (and Frank) for your comments. I'm pleased to say I've sorted out all my problems (and successfully converted another 15000 lines of DEC Pascal to gpc with approx. 2000 line changes to get around DEC specifics - mostly the use of x:= ZERO to clear anything).
You're right - execution time wasn't the key issue. It was more to do with the fact that I had various records with > 10 components, each element having a unique array type. So working out the size of each record was tedious and zeroing with loops meant coding lots of sub-loops for the arrays within the records.
I have effectively adopted approach (1), which is in line with the fact that my_dyn_arr^ points to the first array element already. But for simplicity, I support Frank's suggestion that in future gpc releases, my_dyn_arr^ points to the start of the whole schema so I can do `FillChar' on sizeof(my_dyn_arr^) and then `Initialize' . However, is it really true that a floating point 0.0 isn't always all zero bytes?
Regards
David Wood.
The Information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful.