[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how to access structure elements by a key
From: |
Rafal Mantiuk |
Subject: |
how to access structure elements by a key |
Date: |
Fri, 11 Feb 2005 14:23:33 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a5) Gecko/20041121 |
Hi,
How can I access an element of the structure by its key if the key is
given as a string. That is, having a structure:
a.a = 1;
I would like to get "1", by:
a("a")
or something similar. Actually a("a") causes an error and then assertion
fault and octave crash on 2.1.57:
error: string type invalid as index value
octave: ../liboctave/dim-vector.h:104: int&
dim_vector::dim_vector_rep::elem(int): Assertion `i >= 0 && i < ndims'
failed.
I need such functionality to copy only selected elements from one
structure to another structure while I don't really know what are the
names (keys) of the elements in the first structure.
Thanks,
Rafal
mantiuk.vcf
Description: Vcard
- how to access structure elements by a key,
Rafal Mantiuk <=