============================= System.in Release Notes ============================= Versions: System.in 1.0 Date: 1/27/97 Authors: Clint Popetz, Scott Kovatch, Tim Freehill ================= About System.in ================= System.in is a collection of java classes that will allow you to use System.in.read() calls in your Java applications. Using these classes will display a window titled "System.in" with an edit text field on it. Code that calls System.in.read() will use what you type into the text field as a source. To register your input, type in the text field and hit return to send the text, or Command-D to register an EOF. (Really, CTRL-D should be used, but the text field interprets that as the End key. This may change in the future.) Once started, the System.in window cannot be closed or resized, and stays until you quit Metrowerks Java. If you launch it again, the System.in window will be brought to the front. This class implements a buffered input stream, so if you type ahead into the text field and hit return, your text will be saved in a buffer and used as input. If the buffer is empty, the System.in window will be brought to the front, and the text field focused, ready for your input. This class was provided as a quick and dirty method of providing standard input for Java applications. Implementing System.in in a console window is non-trivial, and may or may not be added to the VM at a future date. We are providing this tool to you to provide a facility for using System.in that you can use today. ==================== Installing System.in ==================== To install these new System.in classes, just copy the file SystemInput.java from the "-> in Java Support/Java Source" folder to the location "Metrowerks:Metrowerks CodeWarrior:Java Support:Java Source:" =============== Using System.in =============== There are two methods demonstrated by this release for using the new System.in classes. The first is to use System.in as a separate java application. To do this, just build the project System.in.µ in the System.in Application folder and double click on the resulting SystemInput zip file. A window titled 'System.in' will appear in the top left of your screen. Now, run your code that uses System.in. The input returned from System.in.read calls will be that typed into the System.in window. This archive contains an example project that uses this. Just build the project System.in Example.prj in the System.in Example folder and double click the resulting droplet. Anything you type into the System.in window will be echoed to the output console window. When the example app terminates, the System.in window isn't affected. The second method of using System.in in your java applications is to create and control the System.in window directly from your java application. This is also demonstrated by the System.in Example. Just edit the file TrivialApplication.java and uncomment the lines marked "// UNCOMMENT THIS FOR EMBEDDED SYSTEM.IN". Rebuild this project, and double click the resulting droplet. (Make sure no other System.in applications are running.) This example creates the System.in window, allows you to input data which is echoed to the output window. When you terminate the System.in buffer by typing "bye", the system.in window is disposed of. ========================== Known Bugs in This Version ========================== This release only supports System.in for getting console input from the user. It's not a full implementation of standard input in that it does not support redirection of input, such as taking input from a text file. ===================== Contacting Metrowerks ===================== For bug reports, technical questions and suggestions, please use the forms in the Release Notes folder on the CD, and send them to support@metrowerks.com You may also post reports, questions and suggestions to comp.sys.mac.programmer.codewarrior comp.sys.mac.oop.powerplant comp.lang.pascal.mac comp.lang.java as appropriate. Metrowerks tech support monitors these newsgroups closely. -------------------------------------------------------------------------------- Clint Popetz Scott Kovatch Metrowerks Corporation -------------------------------------------------------------------------------- ========================== Additions to System.in.zip ========================== To accommodate Pascal-style input of integers, floats, booleans, etc. via System.in, Duane Bailey has developed the classes ReadStream and Assert. These are incorporated into the System.in.zip file so that they can be used in conjunction with the stream I/O window described above. To use the methods readInt, readFloat, readString, etc in these classes, the project System.in.prj must be recompiled to create System.in.zip. System.in.zip must then be moved to the folder Ssytem -> Java -> Classes. For this zip file to be automatically included in a Java application project, it must be added to the project TrivialApplication.prj, which is in the folder MetroWerks CodeWarrior -> Project Stationery -> Java Application For more information on these methods, see the documentation. Allen Tucker August 13, 1997