User`s manual

Example – Creating and Using a Phone Book
5-75
if r == 'y',
try
FOS = java.io.FileOutputStream(pbname);
FOS.close
catch
error(sprintf('Failed to create %s', pbname));
end;
else
return;
end;
end;
3. Create a Hash Table
The example constructs a java.util.Properties object to serve as the hash
table for the data dictionary.
pb_htable = java.util.Properties;
4. Create a File Input Stream
In a try block, the example invokes a FileInputStream constructor with the
name of the phone book file, assigning the object to
FIS. If the call fails, the
catch statement displays an error message and terminates the program.
try
FIS = java.io.FileInputStream(pbname);
catch
error(sprintf('Failed to open %s for reading.', pbname));
end;
5. Load the Phone Book Keys and Close the File Input Stream
The example calls load on the FileInputStream object FIS, to load the phone
book keys and their values (if any) into the hash table. It then closes the file
input stream.
pb_htable.load(FIS);
FIS.close;