Hi NetRexxers,
inspired by this group I played with the FileWriter's write(String) method.
I have the impression that NetRexx Compiler writes an int and not a String.
The following 4 lines ist the simple NetRexx prog with line numbers.
1: dest = FileWriter('dummy.txt', 1)
2: aString = String 'Just some String'
3: dest.write(aString)
4: dest.close()
[D:\]java FileWriterTest
java.lang.NumberFormatException: Just some String
at netrexx.lang.Rexx.toint(Rexx.nrx:607)
at FileWriterTest.main(FileWriterTest.nrx:3)
Looking at the FileWriterTest.crossref shows that aString is a String.
--- Variables for class FileWriterTest ---
aString String v 2= 3
dest FileWriter v 1= 3 4
But looking at the generated Java source, shows, that an int is written.
Changing netrexx.lang.Rexx.toRexx(aString).toint() --> aString in the Java
Source now compiles and runs fine.
/* Generated from 'FileWriterTest.nrx' 5 Jun 1998 14:49:45 [v1.140] */
/* Options: Crossref Decimal Format Logo Trace2 Verbose3 */
public class FileWriterTest{
private static final java.lang.String $0="FileWriterTest.nrx";
public static void main(java.lang.String $0s[]) throws java.io.IOException{
java.io.FileWriter dest;
java.lang.String aString;
dest=new java.io.FileWriter("dummy.txt",true);
aString=netrexx.lang.Rexx.toString(netrexx.lang.Rexx.toRexx("Just some String"));
dest.write((netrexx.lang.Rexx.toRexx(aString).toint()));
dest.close();
return;}
private FileWriterTest(){return;}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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>