[fpc-pascal] How can I implement "thrice" in Free Pascal?

Marco van de Voort marcov at stack.nl
Wed Oct 19 10:36:38 CEST 2011


In our previous episode, Jonas Maebe said:
> >> Right... I tend to forget about these... what would the correct way  
> >> to
> >> copy an array of ref counted types? E.g. an "array of string"?
> 
> For-loops.
> 
> > copy () ? :-)
> 
> copy() cannot be used to concatenate two arrays, because it is a  
> function that returns a new array with contantes of (a potentially sub- 
> array of) the original array.

True. I only reacted on the last bit though. Create a deep copy. Not the
application which copies to a certain element number. There is no procedure
for that. There is a procedure to do it the other way around though (get sub
array from array) called slice.



More information about the fpc-pascal mailing list