help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stepping through structures


From: John Eaton
Subject: Re: Stepping through structures
Date: Thu, 06 Apr 95 09:35:27 EDT

address@hidden (Ted Harding) wrote:

: Is there any way to step through the members of an Octave structure,
: other than by naming all the members explicitly?

Not yet.  What kind of features would you like to see for this?
I expect to at least have a way for you to get a list of the names
(but doing that requires better string handling features) and a way to
ask if a given name is a member of a given structure.
Would something like gawk's

  for (elt in foo) { ... }

be useful?

BTW, I've already implemented a different default way of printing
structures.  For example, here is the output of using one the new
C-style time functions that I wrote last week:

  octave:1> localtime (time ())
  ans = {
    tm_usec = 226808
    tm_year = 95
    tm_mon = 3
    tm_mday = 6
    tm_sec = 8
    tm_zone = CDT
    tm_min = 28
    tm_wday = 4
    tm_hour = 9
    tm_isdst = 1
    tm_yday = 95
  }

If the structures are nested, you can control the number of levels
that are printed with the variable `struct_levels_to_print'.

: (it seems there is no printf output conversion that can accept a
: structure). 

No, but I suppose one could be implemented that works like the new
default print style.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]