|
AppendTo
AppendTo[s, elem] appends elem to the value of s, and resets s to the result.
AppendTo[s, elem] is equivalent to s = Append[s, elem].
AppendTo[s, elem] does not evaluate s.
You can use AppendTo repeatedly to build up a list.
An alternative and often more efficient way to build up a list is to use a sequence of assignments of the form s = s, elem , and then to call Flatten on the resulting structure.
See The Mathematica Book: Section 2.4.4.
See also: PrependTo.
Further Examples
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT. SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION. | |