| Rune Hellem 2005-11-28, 7:51 am |
| Trying to run this simple jacl-script:
<script>
# set User ID/ pwd for portal Login command
# Hint: User ID and passwords should normally not be placed inside a
# configuration script; better use property files or command line arguments
if { $argc != 2 } {
fail "invocation syntax: wpscript testme.jacl <user> <pwd>"
}
set user [lindex $argv 0]
set pwd [lindex $argv 1]
$Portal login $user $pwd
</script>
I works fine, but not if I pass to few or to many arguments, then it fails with the following message:
<message>
WASX7017E: Exception received while running file "testme.jacl"; exception information: com.ibm.bsf.BSFException: error while eval'ing Jac
l expression: invalid command name "fail"
</message>
Have also tried to replace "fail" with "throw new
EvalException", but same goes here...
Guess it's quite obvious, but I can't seem to figure out why...
R.
|