I think David wrote:
> Hi guys,
> I was reading chapter 5 of the book but not too sure how can I actually
> get the console to output the contents of a Java Vector on the console
> as a enumeration.
Well, the easiest way to display the contents of a Vector is to use
its toString method:
Jess> (printout t (?vector toString) crlf)
[25, 10]
Jess>
If you want to print the elements in your own format, or process them
in some other way, you'd use a loop, just as in Java:
Jess> (bind ?enumeration (?vector elements))
<External-Address:java.util.Vector$1>
Jess> (while (?enumeration hasMoreElements)
(printout t (?enumeration nextElement) crlf))
25
10
FALSE
Jess>
(the "FALSE" being the return value of the "while" expression.)
---------------------------------------------------------
Ernest Friedman-Hill
Science and Engineering PSEs Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------