My unit has a record type with an array[0..255] of Integer inside, a few TStringList objects and several dynamic arrays, and I pass them to procedures without thinking much about the parameter kind. Two things surprised me: a procedure that takes a dynamic array by value changed the caller's elements, and a procedure that takes a TStringList by value added lines to the caller's list.
What is actually copied for each kind of type, and when should I write var, const or out?




