HonorGod
asked on
Please explain this unexpected syntax
I have encountered some TCL code (well, Jacl code really), that has the statements shown below.
I understand that #1 creates a new java Object, having a value of 1. So far, so good.
What I don't understand is the 2nd statement. I'm used to seeing
set variableName value
So what is this doing?
set 0 value
and why is this after a dereferenced variable?
If you could explain this, and provide equivalent Jython, it would be greatly appreciated.
Thanks
I understand that #1 creates a new java Object, having a value of 1. So far, so good.
What I don't understand is the 2nd statement. I'm used to seeing
set variableName value
So what is this doing?
set 0 value
and why is this after a dereferenced variable?
If you could explain this, and provide equivalent Jython, it would be greatly appreciated.
Thanks
set params [java::new {java.lang.Object[]} {1}]
$params set 0 [java::field com.ibm.websphere.scheduler.BeanTaskInfo class]
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
According to the Tcl documentation, one would use the "array" keyword to define an array.
So, I'm still confused.
So, I'm still confused.
array set colorcount {
red 1
green 5
blue 4
white 9
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mish33 was completely correct, so gets most of the points.
objects was first, and partially correct, so get some of the points.
Thanks again folks!
objects was first, and partially correct, so get some of the points.
Thanks again folks!
ASKER
Open in new window