On 8/3/07, kathy.irwin <[EMAIL PROTECTED]> wrote:
>
>   Hi Mark,
> The way I found to get around it is to get the number of list
> elements before entering the Tcl2 proc and use that in the for loop.
>
> If anyone knows how to access the WB generated list array, I'd
> appreciate it.
>








Hi Kathy,

The Tcl2 [FME_AttributeNames] returns the same as the old TCL [array names
FME_Attributes], so to see everything, do

foreach name [FME_AttributeNames] {
        puts [format "%-30s %-30s" $name [FME_GetAttribute $name]]
    }

But I prefer to get the number of elements from the list and loop through
that anyway:

# e.g  _list = points
#      num    = 40
#      _attr  = SEIS_PT_LONG
proc FindElement {_list num _attr} {
    set _element_count [FME_Execute NumElements $_list]
    puts \n[concat $_list has $_element_count elements in it]
    for {set i 1} {$i<=$_element_count} {incr i} {
        set _current [FME_GetAttribute $_list{[expr $i - 1]}.$_attr]
        if {$num == $_current} {
            puts [concat Element [expr $i - 1] of $_attr = $num]\n
        }
    }
}

Dan Ise.
Safe Software

Reply via email to