Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7936 > unrolled thread
| Started by | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| First post | 2012-01-17 08:51 +0000 |
| Last post | 2012-01-17 08:51 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: opposite of AppendTo Bob Hanlon <hanlonr357@gmail.com> - 2012-01-17 08:51 +0000
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Date | 2012-01-17 08:51 +0000 |
| Subject | Re: opposite of AppendTo |
| Message-ID | <jf3cpp$npt$1@smc.vnet.net> |
s = Array[x, 4];
AppendTo[s, e]
{x[1], x[2], x[3], x[4], e}
s = Most[s]
{x[1], x[2], x[3], x[4]}
AppendTo[s, e]
{x[1], x[2], x[3], x[4], e}
s = Drop[s, -1]
{x[1], x[2], x[3], x[4]}
AppendTo[s, e]
{x[1], x[2], x[3], x[4], e}
s = s /. e -> Sequence[]
{x[1], x[2], x[3], x[4]}
Bob Hanlon
On Mon, Jan 16, 2012 at 5:12 PM, burke <burket@mailbox.sc.edu> wrote:
> 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!!
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web