Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: opposite of AppendTo

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124345] Re: opposite of AppendTo
  • From: Tomas Garza <tgarza10 at msn.com>
  • Date: Tue, 17 Jan 2012 03:28:40 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201201162212.RAA15438@smc.vnet.net>

If I understand correctly, your problem seems to lie in the use of AppendTo. This is a very tricky function, since it "resets" s without your control and sometimes things get messed up. Perhaps you could try to use simply Append, where you get a new list but s is not changed in the process. Essentially, what AppendTo does is s = Append[s,e].
-Tomas

> Date: Mon, 16 Jan 2012 17:12:16 -0500
> From: burket at mailbox.sc.edu
> Subject: opposite of AppendTo
> To: mathgroup at smc.vnet.net
>
> AppendTo[s,e] appends "e" to "s" and then RESETS "s". How does one
> delete or remove an element "e" from a list "s" and then RESET "s"?
> The _reset_ is my problem.  I want to be able to add and delete
> elements of a list (a list of graphical elements with very low
> opacity).  I can "appendto" the list at will but am unable to delete
> elements (using Delete, DeleteCases, Except, Select, etc.). Deleting
> "e" from "s" is easy enough, but resetting "s" seems impossible.
> Help!!
>


  • Prev by Date: Re: Question about DeleteCases to remove list elements based on first character
  • Next by Date: Re: Question about DeleteCases to remove list elements based on first character
  • Previous by thread: Re: opposite of AppendTo
  • Next by thread: Re: opposite of AppendTo