[tkined] Callback routine not recognized

From: Brock Rycenga (brycenga@wire-less-inc.com)
Date: Mon Oct 02 2000 - 19:23:11 MET DST


Has anyone ever had problems with their call back routine not being
recognized in a loop? Here is an excerpt from my code (no laughing, please).

--------------------------------------------------------
## Build a callback script for the corresponding action
## following the "getnext" command.
set callbk "ConvertAndPrint {%S %R %E %I {%V} %A}"

## Let's get to it.
set vblist [list $dcham_top]
set result [$sid getnext $vblist $callbk]
$sid wait

## Let's walk the entire MIB, retrieving anything that's
## been set.
set notdone 1
while {$notdone} {
    set result [$sid getnext $vblist $callbk]
    $sid wait
}

#########################################################
# #
# proc: ConvertAndPrint #
# #
#########################################################
proc ConvertAndPrint {resultinfo} {
    global vblist notdone

        set errstatus [GetErrorStatus $resultinfo]
        if {[string compare $errstatus "noError"] == 0} {
            set notdone 0
            set errindex [GetErrorIndex $resultinfo]
        }

        set oid [GetOID $resultinfo]
        set type [GetType $resultinfo]
        set value [GetValue $resultinfo]
        set oidname [mib name $oid]
        puts "Returned: $oid, $oidname, $type, $value\n"
        flush stdout

        set vblist [list $oid]
}
--------------------------------------------------------

This is just a simple "walk" of a proprietary MIB, using getnext. If I use a
sequence of getnext calls (without the while loop), everything works just
fine. When I put the 'set result [$sid getnext $vblist $callbk]' inside the
while loop, the script does not function properly. I get the following
error: Error: invalid command name: "Convert and Print". This almost seems
like it is more related to a general Tcl issues (i.e., something I'm doing
wrong); as opposed to a Scotty issue. However, I thought I would start with
you folks, first. Any ideas?

Thanks, in advance!

Regards,
Brock

--
!! 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.



This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:54 MET