[tcljava-user] Load extension in Tcl file
Brought to you by:
mdejong
From: Patrick F. <pfi...@oz...> - 2007-01-11 21:16:55
|
Maybe something like this: Write a class that: 1. Runs the tcl command in-line "puts [clock format [clock seconds] -format %k:%M:%S]" 2. Sources the proc compare. proc compare {howmany value} { for {set i 1} {$i < $howmany} {incr i} { if {$i == $value} { puts $i } } } set bench 1000 set bench2 [expr $bench - 1] puts "comparing an int against $bench others..." compare $bench $bench2 ############################################################################# # import tcl.lang.*; // Java wrapper to test JACL under RAD 6. public class ScriptRunnerTcl { public static void main(String []args) { Interp i = new Interp(); try { i.eval("set x {The time is }"); i.eval("set y [clock format [clock seconds] -format %k:%M:%S]"); i.eval("puts [append z $x $y]"); i.eval("puts \\n"); } catch (TclException e) { System.out.println("Exception: " + e.getMessage()); } try { i.eval("source E:/scripts/TCL/jacl/compare.tcl"); } catch (TclException e) { System.out.println("Exception: " + e.getMessage()); } } } |