[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Removing elements from structures
From: |
Dirk Eddelbuettel |
Subject: |
Re: Removing elements from structures |
Date: |
Thu, 22 Nov 2001 15:16:28 -0600 |
User-agent: |
Mutt/1.3.23i |
On Thu, Nov 22, 2001 at 04:20:57PM -0300, Roberto Hernandez wrote:
> Hi all,
>
> I've been looking through the documentation, but can't find how to
> remove an element from a structure.
>
> Suppose I define the following:
>
> a.name = "Bob"
> a.lastname = "Hope"
> a.phone = "555-5555"
>
> I tried clear(a.phone), but that doesn't remove the element.
If memory servers, you cannot. Write yourself a little wrapper which copies
everything but the element you want to remove in a temp structure, remove
the original, copy the them into the original name and remove the temp one.
Dirk
--
Better to have an approximate answer to the right question
than a precise answer to the wrong question. -- John Tukey
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------