Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: misc.tovector - Function Up: misc - Tool Previous: misc.killspinner - Function


misc.listfields - Function



Package utility
Module misc
Tool misc


Hierarchically list fields in a record


Synopsis
listfields(rec, listdata, depth)



Arguments

rec   Record to list
    Allowed: Glish record
listdata   List data at bottom of record
    Allowed: Boolean
    Default: T
depth   Depth in record
    Allowed: Integer
    Default: 0


Returns
T



Description
This function hiearchically lists the contents of a record by drawing a tree and optionally printing the data at the end of each branch.

If you choose not to list the data at the end of the branch, then its type will be printed for you instead.

The depth argument is just used to offset the printed output as it works its way down the record. If you put some other value, other than 0, then the text will be offset to the right differently. You shouldn't need to use it.



Example
r := [=]
r.x := [=]
r.y := [=];
r.x.a := [1,2,3]
r.x.b := 'trout'
r.y.a := [10,20,30]
r.y.b := 'salmon'
r.y.c := [=]
r.y.c.i := 1
r.y.c.k := [=]
r.y.c.k.x := [1,2,3,4]
r.y.c.k.y := -400
r.y.c.j := 1
#
dms.listfields(r)
  x
    a = [1 2 3] 
    b = trout
  y
    a = [10 20 30] 
    b = salmon
    c
      i = 1
      k
        x = [1 2 3 4] 
        y = -400
      j = 1
#
dms.listfields(r, listdata=F)
  x
    a = integer [3]
    b = string
  y
    a = integer [3]
    b = string
    c
      i = integer
      k
        x = integer [4]
        y = integer
      j = integer





next up previous contents index
Next: misc.tovector - Function Up: misc - Tool Previous: misc.killspinner - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15