Forum OpenACS Q&A: Response to ns_java problem

Collapse
Posted by amit singh on
I am using the latest webmail-defs.tcl from the CVS which has the following code added

<pre>
# if ![string length [info commands ns_java]] {
#    proc ns_java { args } {
#        set i 0
#        if [string equal [lindex $args 0] -detach] {
#            incr i
#        }
#        foreach {class method} [split [lindex $args $i] ::] break
#        set size [expr [llength $args] - $i - 1]
#        set iargs [nsjava::new {String[]} $size]
#        for {incr i} {$i < [llength $args]} {incr i} {
#            $iargs set $i $arg
#        }
#        nsjava::call $class [list $method {String[]}] $iargs
#    }
#}

In line number 11 i changed $arg to $args and got rid of the prevoius error but now i get

"
n error occured while we attempted to compose your message:

array index "2" is out of bounds: must be between 0 and 1

"

thanks in advance