NetRexx uses INT instead of String

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

NetRexx uses INT instead of String

Mike Cowlishaw-2
FileWriter doesn't have a write() method of any kind, so the method
search looks through its superclasses, bottom up.  OutputStreamWriter
has the three write methods:

  write(int)
  write(char[], int, int)
  write(java.lang.String, int, int)

and since you only supplied one argument, only the first of these
is checked, and it's a valid match.  You could call one of the
others by supplying the two extra arguments.

The superclass of OutputStreamWriter is Writer .. and this does have
a write(String) method -- you can force the search to start with this
class by using a cast, for example:

  (Writer dest).write(aString)

or perhaps more simply, have 'dest' be of type Writer, so the program
becomes:

  dest    = Writer FileWriter('dummy.txt', 1)
  aString = String 'Just some String'
  dest.write(aString)
  dest.close()

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mike Cowlishaw, IBM Fellow, IBM UK Laboratories
mailto:[hidden email]   [http://www2.hursley.ibm.com]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>