MathGroup Archive 2001

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

Search the Archive

Variable Names


Hi,

Could someone provide some help with a small problem I have??

I have a list of formatted data with a title. This list is made up of other
elements separately defined. I need to output, to a separate file, the
element data from the list in a formatted way, on separate lines. Then I
need to define the list in terms of the names of the elements within it and
its title.

Currently I apply the element name as part of the list and read it out when
needed, as the elements aren't defined as variables, just elements in a
separate list.
However, how do I then print a line with the list title and then the element
names? Obviously the element names are read from the list individually, but
the list name is a variable representing the list. I can't specify the list
name as a separate variable as it is representative of a list, and it is
very unwieldy to have to define a list in terms of elements and call it
something, and then rename it when it is written to a file.

The crux of my question is, can you take the name of a list and output it as
a string??

For reference, the list would like:

SRS = {{"quad1", Quadruple, 1.2, -2.9, "---", "---", "qd"}, {"sb1",
SectorBend, 3.6, 0.007, "---", 2, "bend"}, {"bpm1", BPM, 0, "---", "---",
"---", "bpm"}}

and the file text should look like:

SRS:  Line = quad1, sb1, bpm1

Any help would be much appreciated,

James Jones
Daresbury Lab.
j.k.jones at dl.ac.uk





  • Prev by Date: RE: DO if Loop
  • Next by Date: Name of a list
  • Previous by thread: Re: Partial Differential Equation
  • Next by thread: Name of a list