changing the %I error index substitution

Jurgen Schonwalder (jschon@research.bell-labs.com)
Sat, 5 Jul 1997 17:44:36 -0400 (EDT)

The current scotty version allows to access the error_index from an
SNMP response PDU through the %I substitution in an asynchronous
request. The current implementation does this by simply converting
error_index into a string. The problem here is that SNMP starts to
count the first varbind list element with 1 while Tcl lists use 0 for
the first index. It is therefore not possible to get the varbind
directly out of the Tcl varbind list, e.g.

set vb [lindex "%V" %I]

does not work. Something like

set vb [lindex "%V" [expr %I - 1]]

does the job, but it looks a bit strange to me. I would like to change
the %I substitution so that you get the Tcl list index and not the
value from the error_index SNMP PDU field. I would substitute %I with
-1 if there was no error. This change would make the first lindex
example work in all cases. Any comments on such a change?

Juergen

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.