Hello Patrick,
when needing FILE I/O in NetRexx, you might find the Rexx2Nrx.RexxFile class useful. This implements 'classic Rexx like' linein, lineout, etc.... You will find the doc on www.Rexx2Nrx.com RunTime routines ... best regards, Tom. > -----Ursprüngliche Nachricht----- > Von: Patric Bechtel [SMTP:[hidden email]] > Gesendet am: Donnerstag, 6. Februar 2003 00:48 > An: [hidden email] > Betreff: Problem with nrc 2.02 > > Hello Mike, hello all, > > I've two quite annoying probs with the current NetRexxC compiler: > > Sample netrexx file: > > options binary strictcase strictargs > [...] > outWriter=FileWriter(outfile) > s=String > [...] > s='test;'id';'name';'count';'CRLF > outWriter.write(char[] s.toCharArray()) > > the last two lines are translated to: > > s=netrexx.lang.Rexx.toString(netrexx.lang.Rexx.toRexx("test;"+id+";"+name+ > ";"+count+";").OpCc(null,CRLF)); > outWriter.write(netrexx.lang.Rexx.toRexx(s.toCharArray()).toint()); > > There are two probs with this code: > 1) I cannot access the write(String) method of the FileWriter class. > Whatever I try, NetRexx always tries to choose the > int version of the write method. I've never seen that before, but in the > IO classes. But maybe anyone has seen a similar > effect too. > 2) Concatenating strings via + in Java is a very bad thing; the code would > better look like > s=StringBuffer("test").append(id).append(";").append(name).append(";").app > end(count).append(";").append(CRLF).toString(); > This would have two very important advantages: It would have less object > creation (each + creates 3 intermediate objects, > as it creates a Stringbuffer, appends one String to another, converts it > to String, so we have 6*3=18 garbage objects, > plus a garbage Rexx object. The second advantage would be the fact that > the Stringbuffer append method is null capable; > so calling the above thing with a null name wouldn't result in an NPE, > which is not very nice in the current > implementation. > > But the most annoying thing in the moment is not being able to access this > write(String) method. > Could you write a fix for that? > > tia > > Patric > > > PGP Public Key Fingerprint: 2636 F26E F523 7D62 4377 D206 7C68 06BB > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~ > 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> |
Free forum by Nabble | Edit this page |