Thread: [tcljava-user] Load extension in Tcl file
Brought to you by:
mdejong
From: Pham N. K. <pn...@ya...> - 2007-01-11 03:33:58
|
Hi all, I'm studying about tcl with Java, and i have a problem with how to load extension from tcl file. The structure of my project is: script: contain scripts (Tcl file) scr: contain Java file I have a these class: package com; public class TestCommand implements tcl.lang.Command { public void cmdProc(...) {...} } and package com; public class TestCommandExtension implements tcl.lang.Extension { public void init(...) { // create a TestCommand } } How to load TestCommandExtsion from script store in script folder as i mention above with this situation ? (I'm using Windows XP) Please help ! Thanks //Khanh ___________________________________________________________ What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship. http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk |
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()); } } } |
From: rahul <Rah...@Su...> - 2007-01-12 14:58:04
|
[Pham Ngoc Khanh:] | script: contain scripts (Tcl file) | scr: contain Java file ================= | package com; | public class TestCommand implements tcl.lang.Command { | public void cmdProc(...) {...} | } ================= | package com; | | public class TestCommandExtension implements | tcl.lang.Extension { | public void init(...) { | // create a TestCommand | } | } | | How to load TestCommandExtsion from script store in | script folder as i mention above with this situation ? | (I'm using Windows XP) =============== # do this.... package require java java::load -classpath {../scr} com.TestCommandExtension =============== |
From: Imran S. <isa...@gm...> - 2007-01-12 19:43:32
|
Hi plz tell me how to made model of Differentiated services and integrated services of ip packet in tcl thanks On 1/12/07, rahul <Rah...@su...> wrote: > > [Pham Ngoc Khanh:] > | script: contain scripts (Tcl file) > | scr: contain Java file > ================= > | package com; > | public class TestCommand implements tcl.lang.Command { > | public void cmdProc(...) {...} > | } > ================= > | package com; > | > | public class TestCommandExtension implements > | tcl.lang.Extension { > | public void init(...) { > | // create a TestCommand > | } > | } > | > | How to load TestCommandExtsion from script store in > | script folder as i mention above with this situation ? > | (I'm using Windows XP) > =============== > # do this.... > package require java > > java::load -classpath {../scr} com.TestCommandExtension > =============== > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > -- With Regards: Imran ------ |
From: Pham N. K. <pn...@ya...> - 2007-01-15 02:14:05
|
Thanks Rahul. It works. //Khanh --- rahul <Rah...@Su...> wrote: > [Pham Ngoc Khanh:] > | script: contain scripts (Tcl file) > | scr: contain Java file > ================= > | package com; > | public class TestCommand implements > tcl.lang.Command { > | public void cmdProc(...) {...} > | } > ================= > | package com; > | > | public class TestCommandExtension implements > | tcl.lang.Extension { > | public void init(...) { > | // create a TestCommand > | } > | } > | > | How to load TestCommandExtsion from script store > in > | script folder as i mention above with this > situation ? > | (I'm using Windows XP) > =============== > # do this.... > package require java > > java::load -classpath {../scr} > com.TestCommandExtension > =============== > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get > the chance to share your > opinions on IT & business topics through brief > surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > ___________________________________________________________ The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html |