Hi there again,
first, I must admit that I am *NO* Java *NOR* NetRexx Expert. second, I would like to enhance my FILE-Access routines (current doc in \Rexx2RT\RexxFile (in the Run-Time package of www.Rexx2Nrx.com since years) to do the following: -- using a special (computer independent) Syntax to read 'the members of: -- a JAR File -- a ZIP File -- an IBM zOS PDS file ON demand (e.g. to use linein, lineout, and all the other things already implemented in RexxFile (without the need to CHANGE the 'calling program') Also, the '/' may now be used as a GENRIC File-separator (translated to '\' in the Windows case...) Questions: 1.) What do you suggest as the proper syntax for the LIBRARY Name preceeding the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) 2.) Does anyone of you have a (small) example how I can read/write the LINES of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. Tom. PS: I already got from Walter Pachl some (very old & very good) examples how to read an IBM PDS File thru EXECIO. I am currently testing my own implementation of EXECIO for Rexx2Nrx. Thomas Schneider.
Tom. (ths@db-123.com)
|
Thomas,
ZIP and JAR are the same thing. There is standard stuff in the java library for manipulating this format. Look at the package java.util.zip classes. David 2010/2/12 Thomas Schneider <[hidden email]> > Hi there again, > first, I must admit that I am *NO* Java *NOR* NetRexx Expert. > second, I would like to enhance my FILE-Access routines (current doc in > \Rexx2RT\RexxFile > (in the Run-Time package of www.Rexx2Nrx.com since years) to do the > following: > > -- using a special (computer independent) Syntax to read 'the members of: > > -- a JAR File > -- a ZIP File > -- an IBM zOS PDS file > > ON demand (e.g. to use linein, lineout, and all the other things already > implemented > in RexxFile (without the need to CHANGE the 'calling program') > > Also, the '/' may now be used as a GENRIC File-separator (translated to '\' > in the > Windows case...) > > Questions: > > 1.) What do you suggest as the proper syntax for the LIBRARY Name > preceeding > the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) > > 2.) Does anyone of you have a (small) example how I can read/write the > LINES > of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. > > Tom. > > PS: I already got from Walter Pachl some (very old & very good) examples > how to read an IBM PDS File thru EXECIO. > > I am currently testing my own implementation of EXECIO for Rexx2Nrx. > Thomas Schneider. > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > -- Saludos / Regards, David Requena -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ns.hursley.ibm.com/pipermail/ibm-netrexx/attachments/20100213/39757a34/attachment.html |
Hi Divid,
.. many thanks for the Details. ... MFC already said me the same thins! Isn't that (OUR) Universe ... ..... a UNIQUE thing ?? Thomas. ... will read your message (below) tomorrow in more detail. = Did archive it now, I'm gooing a'sleeeeep ... ================================================================= David Requena schrieb: > Thomas, > > ZIP and JAR are the same thing. > > There is standard stuff in the java library for manipulating this format. > Look at the package java.util.zip classes. > > David > > 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> > > Hi there again, > first, I must admit that I am *NO* Java *NOR* NetRexx Expert. > second, I would like to enhance my FILE-Access routines (current > doc in \Rexx2RT\RexxFile > (in the Run-Time package of www.Rexx2Nrx.com > <http://www.Rexx2Nrx.com> since years) to do the following: > > -- using a special (computer independent) Syntax to read 'the > members of: > > -- a JAR File > -- a ZIP File > -- an IBM zOS PDS file > > ON demand (e.g. to use linein, lineout, and all the other things > already implemented > in RexxFile (without the need to CHANGE the 'calling program') > > Also, the '/' may now be used as a GENRIC File-separator > (translated to '\' in the > Windows case...) > > Questions: > > 1.) What do you suggest as the proper syntax for the LIBRARY Name > preceeding > the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) > > 2.) Does anyone of you have a (small) example how I can read/write > the LINES > of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. > > Tom. > > PS: I already got from Walter Pachl some (very old & very good) > examples > how to read an IBM PDS File thru EXECIO. > > I am currently testing my own implementation of EXECIO for Rexx2Nrx. > Thomas Schneider. > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] <mailto:[hidden email]> > > > > > -- > Saludos / Regards, > David Requena > > ------------------------------------------------------------------------ > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > >
Tom. (ths@db-123.com)
|
In reply to this post by David Requena
An HTML attachment was scrubbed...
URL: http://ns.hursley.ibm.com/pipermail/ibm-netrexx/attachments/20100213/5c656603/attachment.html
Tom. (ths@db-123.com)
|
In reply to this post by Thomas.Schneider.Wien
Thomas ;
There was an exchange about reading Zip/Jar files on the list last month. I don't know if you were on the list then, so I am attaching it here. It sounds like you might be interested in the actual code to read the data also, so here it is: ------------------------------------------------------ general purpose routines ------------------------------------------------------- method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) -- method to copy a jarfile entry to a directory if df then trace results nrscript=scriptdir||fs||je.getName nrs=File(nrscript) if \nrs.exists then do rc=copyjarentrytofile(jf,je,nrs) if rc=1 then say je.getName "copied to:" scriptdir end method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) if df then trace results do scriptstream=jf.getInputStream(je) if Rexx(je.getName).pos(".class")=0 then do scriptreader=BufferedReader(InputStreamReader(scriptstream)) -- scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) scriptwriter=BufferedWriter(FileWriter(nrs)) copyfile(scriptreader,scriptwriter) scriptwriter.close end else do outstream=FileOutputStream(nrs) copybin(scriptstream,outstream) outstream.close end catch badguy=Exception say je.getName "copy error =" badguy return 0 end return 1 /* methods to copy a file: */ method copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) signals IOException if df then trace results line=ifq.readline if line = null then return ofq.write(string line,0,line.length) trace off loop forever line=ifq.readline if line = null then leave ofq.newline() ofq.write(string line,0,line.length) end method copybin(ifq=InputStream,ofq=OutputStream) binary signals IOException bite=ifq.read loop while bite \= -1 ofq.write(bite) bite=ifq.read end --------------------------------------------------------------------------------------------------------------------------------------------------- Kinda crude, but maybe it helps. note: fs=File.separator -- Kermit Thomas Schneider wrote: > Hi Divid, > .. many thanks for the Details. > ... MFC already said me the same thins! > > Isn't that (OUR) Universe ... > > ..... a UNIQUE thing ?? > Thomas. > ... will read your message (below) tomorrow in more detail. > = Did archive it now, I'm gooing a'sleeeeep ... > ================================================================= > David Requena schrieb: >> Thomas, >> >> ZIP and JAR are the same thing. >> >> There is standard stuff in the java library for manipulating this >> format. >> Look at the package java.util.zip classes. >> >> David >> >> 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> >> >> Hi there again, >> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >> second, I would like to enhance my FILE-Access routines (current >> doc in \Rexx2RT\RexxFile >> (in the Run-Time package of www.Rexx2Nrx.com >> <http://www.Rexx2Nrx.com> since years) to do the following: >> >> -- using a special (computer independent) Syntax to read 'the >> members of: >> >> -- a JAR File >> -- a ZIP File >> -- an IBM zOS PDS file >> >> ON demand (e.g. to use linein, lineout, and all the other things >> already implemented >> in RexxFile (without the need to CHANGE the 'calling program') >> >> Also, the '/' may now be used as a GENRIC File-separator >> (translated to '\' in the >> Windows case...) >> >> Questions: >> >> 1.) What do you suggest as the proper syntax for the LIBRARY Name >> preceeding >> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >> >> 2.) Does anyone of you have a (small) example how I can read/write >> the LINES >> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >> >> Tom. >> >> PS: I already got from Walter Pachl some (very old & very good) >> examples >> how to read an IBM PDS File thru EXECIO. >> >> I am currently testing my own implementation of EXECIO for Rexx2Nrx. >> Thomas Schneider. >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] <mailto:[hidden email]> >> >> >> >> >> -- >> Saludos / Regards, >> David Requena >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> >> > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > > An embedded message was scrubbed... From: Kermit Kiser <[hidden email]> Subject: Re: [Ibm-netrexx] Help Needed - Date: Wed, 13 Jan 2010 17:19:33 -0800 Size: 8746 Url: http://ns.hursley.ibm.com/pipermail/ibm-netrexx/attachments/20100212/b142b609/Ibm-netrexxHelpNeeded--0001.eml |
Kermit,
hmm.. got curious. I noticed the following on your supplied code snipped: if df then trace results Here I'm supposing df is a property appropriately set up upstream as needed. This is a construct I've used often in other languages but in NetRexx I tend to use trace statements liberally as needed. Then for production build I use 'options notrace' so no overhead is incurred. Any reason why would you prefer the conditional check over NetRexx' options nobinary idiom? Maybe I'm being dumb but seems to me the conditional would be carried to production code whereas options nobinary would eliminate any trace (yeah, redundant) of trace code. --- Saludos / Kind regards. David Requena El 13/02/2010 8:16, Kermit Kiser escribi?: > Thomas ; > > There was an exchange about reading Zip/Jar files on the list last > month. I don't know if you were on the list then, so I am attaching it > here. > > It sounds like you might be interested in the actual code to read the > data also, so here it is: > > ------------------------------------------------------ general purpose > routines ------------------------------------------------------- > > method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) -- > method to copy a jarfile entry to a directory > > if df then trace results > nrscript=scriptdir||fs||je.getName > > nrs=File(nrscript) > > if \nrs.exists then do > > rc=copyjarentrytofile(jf,je,nrs) > > if rc=1 then say je.getName "copied to:" scriptdir > > end > > > method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) > > if df then trace results > > do > > scriptstream=jf.getInputStream(je) > > if Rexx(je.getName).pos(".class")=0 then do > > > scriptreader=BufferedReader(InputStreamReader(scriptstream)) > > -- > scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) > > scriptwriter=BufferedWriter(FileWriter(nrs)) > > copyfile(scriptreader,scriptwriter) > > scriptwriter.close > > end > > else do > > outstream=FileOutputStream(nrs) > > copybin(scriptstream,outstream) > > outstream.close > > end > > catch badguy=Exception > > say je.getName "copy error =" badguy > > return 0 > > end > > return 1 > > > /* methods to copy a file: */ > > method copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) > signals IOException > > if df then trace results > > line=ifq.readline > > if line = null then return > > ofq.write(string line,0,line.length) > > trace off > > loop forever > > line=ifq.readline > > if line = null then leave > > ofq.newline() > > ofq.write(string line,0,line.length) > > end > method copybin(ifq=InputStream,ofq=OutputStream) binary signals > IOException > > bite=ifq.read > > loop while bite \= -1 > > ofq.write(bite) > > bite=ifq.read > > end > --------------------------------------------------------------------------------------------------------------------------------------------------- > > > > Kinda crude, but maybe it helps. > > note: fs=File.separator > > -- Kermit > > > Thomas Schneider wrote: >> Hi Divid, >> .. many thanks for the Details. >> ... MFC already said me the same thins! >> >> Isn't that (OUR) Universe ... >> >> ..... a UNIQUE thing ?? >> Thomas. >> ... will read your message (below) tomorrow in more detail. >> = Did archive it now, I'm gooing a'sleeeeep ... >> ================================================================= >> David Requena schrieb: >>> Thomas, >>> >>> ZIP and JAR are the same thing. >>> >>> There is standard stuff in the java library for manipulating this >>> format. >>> Look at the package java.util.zip classes. >>> >>> David >>> >>> 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> >>> >>> Hi there again, >>> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >>> second, I would like to enhance my FILE-Access routines (current >>> doc in \Rexx2RT\RexxFile >>> (in the Run-Time package of www.Rexx2Nrx.com >>> <http://www.Rexx2Nrx.com> since years) to do the following: >>> >>> -- using a special (computer independent) Syntax to read 'the >>> members of: >>> >>> -- a JAR File >>> -- a ZIP File >>> -- an IBM zOS PDS file >>> >>> ON demand (e.g. to use linein, lineout, and all the other things >>> already implemented >>> in RexxFile (without the need to CHANGE the 'calling program') >>> >>> Also, the '/' may now be used as a GENRIC File-separator >>> (translated to '\' in the >>> Windows case...) >>> >>> Questions: >>> >>> 1.) What do you suggest as the proper syntax for the LIBRARY Name >>> preceeding >>> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >>> >>> 2.) Does anyone of you have a (small) example how I can read/write >>> the LINES >>> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >>> >>> Tom. >>> >>> PS: I already got from Walter Pachl some (very old & very good) >>> examples >>> how to read an IBM PDS File thru EXECIO. >>> >>> I am currently testing my own implementation of EXECIO for >>> Rexx2Nrx. >>> Thomas Schneider. >>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] <mailto:[hidden email]> >>> >>> >>> >>> >>> -- >>> Saludos / Regards, >>> David Requena >>> >>> ------------------------------------------------------------------------ >>> >>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> >> >> > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > An HTML attachment was scrubbed... URL: http://ns.hursley.ibm.com/pipermail/ibm-netrexx/attachments/20100215/b077b83f/attachment-0001.html |
Hi David,
I'm using a similar approach than Kermit, to have an OPTION to *Dynamically* force DEBUG. I'm rarely using TRACE, but I do have a lot of conditional debugs in my program, which I can even use in the PRODUCTION version just in case a not anticipated situation occurs in the program of a client. This is just for your info. Similarly, I do use a lot of assertions in my code, and did invent some special notation for those in my newer programs, e.g.: x=3 y=x ::= 3 where :: introduces an assertion, which is checked at run tyme (in this case, y MUST be 3) when it is NOT 3, an ASSERTION error message is given (and when not otherwise wanted, the program aborts immediately. Tom. ======================================================== Kermit, please give us the reson of cyour decision as well. David Requena schrieb: > Kermit, > > hmm.. got curious. I noticed the following on your supplied code snipped: > > if df then trace results > > Here I'm supposing df is a property appropriately set up upstream as > needed. > > This is a construct I've used often in other languages but in NetRexx > I tend to use trace statements liberally as needed. Then for > production build I use 'options notrace' so no overhead is incurred. > > Any reason why would you prefer the conditional check over NetRexx' > options nobinary idiom? > > Maybe I'm being dumb but seems to me the conditional would be carried > to production code whereas options nobinary would eliminate any trace > (yeah, redundant) of trace code. > > --- > Saludos / Kind regards. > David Requena > > El 13/02/2010 8:16, Kermit Kiser escribi?: >> Thomas ; >> >> There was an exchange about reading Zip/Jar files on the list last >> month. I don't know if you were on the list then, so I am attaching >> it here. >> >> It sounds like you might be interested in the actual code to read the >> data also, so here it is: >> >> ------------------------------------------------------ general >> purpose routines ------------------------------------------------------- >> >> method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) -- >> method to copy a jarfile entry to a directory >> >> if df then trace results >> nrscript=scriptdir||fs||je.getName >> >> nrs=File(nrscript) >> >> if \nrs.exists then do >> >> rc=copyjarentrytofile(jf,je,nrs) >> >> if rc=1 then say je.getName "copied to:" scriptdir >> >> end >> >> >> method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) >> >> if df then trace results >> >> do >> >> scriptstream=jf.getInputStream(je) >> >> if Rexx(je.getName).pos(".class")=0 then do >> >> >> scriptreader=BufferedReader(InputStreamReader(scriptstream)) >> >> -- >> scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) >> >> scriptwriter=BufferedWriter(FileWriter(nrs)) >> >> copyfile(scriptreader,scriptwriter) >> >> scriptwriter.close >> >> end >> >> else do >> >> outstream=FileOutputStream(nrs) >> >> copybin(scriptstream,outstream) >> >> outstream.close >> >> end >> >> catch badguy=Exception >> >> say je.getName "copy error =" badguy >> >> return 0 >> >> end >> >> return 1 >> >> >> /* methods to copy a file: */ >> >> method >> copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) >> signals IOException >> >> if df then trace results >> >> line=ifq.readline >> >> if line = null then return >> >> ofq.write(string line,0,line.length) >> >> trace off >> >> loop forever >> >> line=ifq.readline >> >> if line = null then leave >> >> ofq.newline() >> >> ofq.write(string line,0,line.length) >> >> end >> method copybin(ifq=InputStream,ofq=OutputStream) binary signals >> IOException >> >> bite=ifq.read >> >> loop while bite \= -1 >> >> ofq.write(bite) >> >> bite=ifq.read >> >> end >> --------------------------------------------------------------------------------------------------------------------------------------------------- >> >> >> >> Kinda crude, but maybe it helps. >> >> note: fs=File.separator >> >> -- Kermit >> >> >> Thomas Schneider wrote: >>> Hi Divid, >>> .. many thanks for the Details. >>> ... MFC already said me the same thins! >>> >>> Isn't that (OUR) Universe ... >>> >>> ..... a UNIQUE thing ?? >>> Thomas. >>> ... will read your message (below) tomorrow in more detail. >>> = Did archive it now, I'm gooing a'sleeeeep ... >>> ================================================================= >>> David Requena schrieb: >>>> Thomas, >>>> >>>> ZIP and JAR are the same thing. >>>> >>>> There is standard stuff in the java library for manipulating this >>>> format. >>>> Look at the package java.util.zip classes. >>>> >>>> David >>>> >>>> 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> >>>> >>>> Hi there again, >>>> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >>>> second, I would like to enhance my FILE-Access routines (current >>>> doc in \Rexx2RT\RexxFile >>>> (in the Run-Time package of www.Rexx2Nrx.com >>>> <http://www.Rexx2Nrx.com> since years) to do the following: >>>> >>>> -- using a special (computer independent) Syntax to read 'the >>>> members of: >>>> >>>> -- a JAR File >>>> -- a ZIP File >>>> -- an IBM zOS PDS file >>>> >>>> ON demand (e.g. to use linein, lineout, and all the other things >>>> already implemented >>>> in RexxFile (without the need to CHANGE the 'calling program') >>>> >>>> Also, the '/' may now be used as a GENRIC File-separator >>>> (translated to '\' in the >>>> Windows case...) >>>> >>>> Questions: >>>> >>>> 1.) What do you suggest as the proper syntax for the LIBRARY Name >>>> preceeding >>>> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >>>> >>>> 2.) Does anyone of you have a (small) example how I can read/write >>>> the LINES >>>> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >>>> >>>> Tom. >>>> >>>> PS: I already got from Walter Pachl some (very old & very good) >>>> examples >>>> how to read an IBM PDS File thru EXECIO. >>>> >>>> I am currently testing my own implementation of EXECIO for >>>> Rexx2Nrx. >>>> Thomas Schneider. >>>> >>>> _______________________________________________ >>>> Ibm-netrexx mailing list >>>> [hidden email] <mailto:[hidden email]> >>>> >>>> >>>> >>>> >>>> -- >>>> Saludos / Regards, >>>> David Requena >>>> >>>> ------------------------------------------------------------------------ >>>> >>>> >>>> _______________________________________________ >>>> Ibm-netrexx mailing list >>>> [hidden email] >>>> >>>> >>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> >>> >>> >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> >> > ------------------------------------------------------------------------ > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > >
Tom. (ths@db-123.com)
|
Thomas,
That is indeed a very valid point. Thought of the possibility of activating debug mode on production code by using some command line switch just after sending my previous email. Thanks, David --- Saludos / Kind regards. David Requena El 15/02/2010 13:44, Thomas Schneider escribi?: > Hi David, > I'm using a similar approach than Kermit, to have an OPTION to > *Dynamically* force DEBUG. > I'm rarely using TRACE, but I do have a lot of conditional debugs in > my program, which I can even > use in the PRODUCTION version just in case a not anticipated situation > occurs in the program > of a client. > > This is just for your info. > > Similarly, I do use a lot of assertions in my code, and did invent > some special notation > for those in my newer programs, e.g.: > > x=3 > y=x ::= 3 > > where :: introduces an assertion, which is checked at run tyme (in > this case, y MUST be 3) > > when it is NOT 3, an ASSERTION error message is given (and when not > otherwise wanted, > the program aborts immediately. > > Tom. > ======================================================== > Kermit, please give us the reson of cyour decision as well. > > David Requena schrieb: >> Kermit, >> >> hmm.. got curious. I noticed the following on your supplied code >> snipped: >> >> if df then trace results >> >> Here I'm supposing df is a property appropriately set up upstream as >> needed. >> >> This is a construct I've used often in other languages but in NetRexx >> I tend to use trace statements liberally as needed. Then for >> production build I use 'options notrace' so no overhead is incurred. >> >> Any reason why would you prefer the conditional check over NetRexx' >> options nobinary idiom? >> >> Maybe I'm being dumb but seems to me the conditional would be carried >> to production code whereas options nobinary would eliminate any trace >> (yeah, redundant) of trace code. >> >> --- >> Saludos / Kind regards. >> David Requena >> >> El 13/02/2010 8:16, Kermit Kiser escribi?: >>> Thomas ; >>> >>> There was an exchange about reading Zip/Jar files on the list last >>> month. I don't know if you were on the list then, so I am attaching >>> it here. >>> >>> It sounds like you might be interested in the actual code to read >>> the data also, so here it is: >>> >>> ------------------------------------------------------ general >>> purpose routines >>> ------------------------------------------------------- >>> >>> method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) >>> -- method to copy a jarfile entry to a directory >>> >>> if df then trace results nrscript=scriptdir||fs||je.getName >>> >>> nrs=File(nrscript) >>> >>> if \nrs.exists then do >>> >>> rc=copyjarentrytofile(jf,je,nrs) >>> >>> if rc=1 then say je.getName "copied to:" scriptdir >>> >>> end >>> >>> method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) >>> >>> if df then trace results >>> >>> do >>> >>> scriptstream=jf.getInputStream(je) >>> >>> if Rexx(je.getName).pos(".class")=0 then do >>> >>> >>> scriptreader=BufferedReader(InputStreamReader(scriptstream)) >>> >>> -- >>> scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) >>> >>> scriptwriter=BufferedWriter(FileWriter(nrs)) >>> >>> copyfile(scriptreader,scriptwriter) >>> >>> scriptwriter.close >>> >>> end >>> >>> else do >>> >>> outstream=FileOutputStream(nrs) >>> >>> copybin(scriptstream,outstream) >>> >>> outstream.close >>> >>> end >>> >>> catch badguy=Exception >>> >>> say je.getName "copy error =" badguy >>> >>> return 0 >>> >>> end >>> >>> return 1 >>> >>> /* methods to copy a file: */ >>> >>> method >>> copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) >>> signals IOException >>> >>> if df then trace results >>> >>> line=ifq.readline >>> >>> if line = null then return >>> >>> ofq.write(string line,0,line.length) >>> >>> trace off >>> >>> loop forever >>> >>> line=ifq.readline >>> >>> if line = null then leave >>> >>> ofq.newline() >>> >>> ofq.write(string line,0,line.length) >>> >>> end method copybin(ifq=InputStream,ofq=OutputStream) binary >>> signals IOException >>> >>> bite=ifq.read >>> >>> loop while bite \= -1 >>> >>> ofq.write(bite) >>> >>> bite=ifq.read >>> >>> end >>> --------------------------------------------------------------------------------------------------------------------------------------------------- >>> >>> >>> >>> Kinda crude, but maybe it helps. >>> >>> note: fs=File.separator >>> >>> -- Kermit >>> >>> >>> Thomas Schneider wrote: >>>> Hi Divid, >>>> .. many thanks for the Details. >>>> ... MFC already said me the same thins! >>>> >>>> Isn't that (OUR) Universe ... >>>> >>>> ..... a UNIQUE thing ?? >>>> Thomas. >>>> ... will read your message (below) tomorrow in more detail. >>>> = Did archive it now, I'm gooing a'sleeeeep ... >>>> ================================================================= >>>> David Requena schrieb: >>>>> Thomas, >>>>> >>>>> ZIP and JAR are the same thing. >>>>> >>>>> There is standard stuff in the java library for manipulating this >>>>> format. >>>>> Look at the package java.util.zip classes. >>>>> >>>>> David >>>>> >>>>> 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> >>>>> >>>>> Hi there again, >>>>> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >>>>> second, I would like to enhance my FILE-Access routines (current >>>>> doc in \Rexx2RT\RexxFile >>>>> (in the Run-Time package of www.Rexx2Nrx.com >>>>> <http://www.Rexx2Nrx.com> since years) to do the following: >>>>> >>>>> -- using a special (computer independent) Syntax to read 'the >>>>> members of: >>>>> >>>>> -- a JAR File >>>>> -- a ZIP File >>>>> -- an IBM zOS PDS file >>>>> >>>>> ON demand (e.g. to use linein, lineout, and all the other things >>>>> already implemented >>>>> in RexxFile (without the need to CHANGE the 'calling program') >>>>> >>>>> Also, the '/' may now be used as a GENRIC File-separator >>>>> (translated to '\' in the >>>>> Windows case...) >>>>> >>>>> Questions: >>>>> >>>>> 1.) What do you suggest as the proper syntax for the LIBRARY Name >>>>> preceeding >>>>> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >>>>> >>>>> 2.) Does anyone of you have a (small) example how I can >>>>> read/write >>>>> the LINES >>>>> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >>>>> >>>>> Tom. >>>>> >>>>> PS: I already got from Walter Pachl some (very old & very good) >>>>> examples >>>>> how to read an IBM PDS File thru EXECIO. >>>>> >>>>> I am currently testing my own implementation of EXECIO for >>>>> Rexx2Nrx. >>>>> Thomas Schneider. >>>>> >>>>> _______________________________________________ >>>>> Ibm-netrexx mailing list >>>>> [hidden email] <mailto:[hidden email]> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Saludos / Regards, >>>>> David Requena >>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> >>>>> _______________________________________________ >>>>> Ibm-netrexx mailing list >>>>> [hidden email] >>>>> >>>> >>>> _______________________________________________ >>>> Ibm-netrexx mailing list >>>> [hidden email] >>>> >>>> >>>> >>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > |
Hello David,
I am (first time) trying to attach a PIECE of my source-code, namely the Options.nrx file, for two purposes: 1.) To inform you of the Options available in Rey. 2.) To *test* (for my own knowledge) whether the IBM NetRexx Groups does allow to send ATTACHED files (which REXXLA does NOT!). Tom. David Requena schrieb: > Thomas, > > That is indeed a very valid point. > Thought of the possibility of activating debug mode on production code > by using some command line switch just after sending my previous email. > > Thanks, > David > > --- > Saludos / Kind regards. > David Requena > > > El 15/02/2010 13:44, Thomas Schneider escribi?: >> Hi David, >> I'm using a similar approach than Kermit, to have an OPTION to >> *Dynamically* force DEBUG. >> I'm rarely using TRACE, but I do have a lot of conditional debugs in >> my program, which I can even >> use in the PRODUCTION version just in case a not anticipated >> situation occurs in the program >> of a client. >> >> This is just for your info. >> >> Similarly, I do use a lot of assertions in my code, and did invent >> some special notation >> for those in my newer programs, e.g.: >> >> x=3 >> y=x ::= 3 >> >> where :: introduces an assertion, which is checked at run tyme (in >> this case, y MUST be 3) >> >> when it is NOT 3, an ASSERTION error message is given (and when not >> otherwise wanted, >> the program aborts immediately. >> >> Tom. >> ======================================================== >> Kermit, please give us the reson of cyour decision as well. >> >> David Requena schrieb: >>> Kermit, >>> >>> hmm.. got curious. I noticed the following on your supplied code >>> snipped: >>> >>> if df then trace results >>> >>> Here I'm supposing df is a property appropriately set up upstream as >>> needed. >>> >>> This is a construct I've used often in other languages but in >>> NetRexx I tend to use trace statements liberally as needed. Then for >>> production build I use 'options notrace' so no overhead is incurred. >>> >>> Any reason why would you prefer the conditional check over NetRexx' >>> options nobinary idiom? >>> >>> Maybe I'm being dumb but seems to me the conditional would be >>> carried to production code whereas options nobinary would eliminate >>> any trace (yeah, redundant) of trace code. >>> >>> --- >>> Saludos / Kind regards. >>> David Requena >>> >>> El 13/02/2010 8:16, Kermit Kiser escribi?: >>>> Thomas ; >>>> >>>> There was an exchange about reading Zip/Jar files on the list last >>>> month. I don't know if you were on the list then, so I am attaching >>>> it here. >>>> >>>> It sounds like you might be interested in the actual code to read >>>> the data also, so here it is: >>>> >>>> ------------------------------------------------------ general >>>> purpose routines >>>> ------------------------------------------------------- >>>> >>>> method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) >>>> -- method to copy a jarfile entry to a directory >>>> >>>> if df then trace results nrscript=scriptdir||fs||je.getName >>>> >>>> nrs=File(nrscript) >>>> >>>> if \nrs.exists then do >>>> >>>> rc=copyjarentrytofile(jf,je,nrs) >>>> >>>> if rc=1 then say je.getName "copied to:" scriptdir >>>> >>>> end >>>> >>>> method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) >>>> >>>> if df then trace results >>>> >>>> do >>>> >>>> scriptstream=jf.getInputStream(je) >>>> >>>> if Rexx(je.getName).pos(".class")=0 then do >>>> >>>> >>>> scriptreader=BufferedReader(InputStreamReader(scriptstream)) >>>> >>>> -- >>>> scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) >>>> >>>> scriptwriter=BufferedWriter(FileWriter(nrs)) >>>> >>>> copyfile(scriptreader,scriptwriter) >>>> >>>> scriptwriter.close >>>> >>>> end >>>> >>>> else do >>>> >>>> outstream=FileOutputStream(nrs) >>>> >>>> copybin(scriptstream,outstream) >>>> >>>> outstream.close >>>> >>>> end >>>> >>>> catch badguy=Exception >>>> >>>> say je.getName "copy error =" badguy >>>> >>>> return 0 >>>> >>>> end >>>> >>>> return 1 >>>> >>>> /* methods to copy a file: */ >>>> >>>> method >>>> copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) >>>> signals IOException >>>> >>>> if df then trace results >>>> >>>> line=ifq.readline >>>> >>>> if line = null then return >>>> >>>> ofq.write(string line,0,line.length) >>>> >>>> trace off >>>> >>>> loop forever >>>> >>>> line=ifq.readline >>>> >>>> if line = null then leave >>>> >>>> ofq.newline() >>>> >>>> ofq.write(string line,0,line.length) >>>> >>>> end method copybin(ifq=InputStream,ofq=OutputStream) >>>> binary signals IOException >>>> >>>> bite=ifq.read >>>> >>>> loop while bite \= -1 >>>> >>>> ofq.write(bite) >>>> >>>> bite=ifq.read >>>> >>>> end >>>> --------------------------------------------------------------------------------------------------------------------------------------------------- >>>> >>>> >>>> >>>> Kinda crude, but maybe it helps. >>>> >>>> note: fs=File.separator >>>> >>>> -- Kermit >>>> >>>> >>>> Thomas Schneider wrote: >>>>> Hi Divid, >>>>> .. many thanks for the Details. >>>>> ... MFC already said me the same thins! >>>>> >>>>> Isn't that (OUR) Universe ... >>>>> >>>>> ..... a UNIQUE thing ?? >>>>> Thomas. >>>>> ... will read your message (below) tomorrow in more detail. >>>>> = Did archive it now, I'm gooing a'sleeeeep ... >>>>> ================================================================= >>>>> David Requena schrieb: >>>>>> Thomas, >>>>>> >>>>>> ZIP and JAR are the same thing. >>>>>> >>>>>> There is standard stuff in the java library for manipulating this >>>>>> format. >>>>>> Look at the package java.util.zip classes. >>>>>> >>>>>> David >>>>>> >>>>>> 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> >>>>>> >>>>>> Hi there again, >>>>>> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >>>>>> second, I would like to enhance my FILE-Access routines >>>>>> (current >>>>>> doc in \Rexx2RT\RexxFile >>>>>> (in the Run-Time package of www.Rexx2Nrx.com >>>>>> <http://www.Rexx2Nrx.com> since years) to do the following: >>>>>> >>>>>> -- using a special (computer independent) Syntax to read 'the >>>>>> members of: >>>>>> >>>>>> -- a JAR File >>>>>> -- a ZIP File >>>>>> -- an IBM zOS PDS file >>>>>> >>>>>> ON demand (e.g. to use linein, lineout, and all the other things >>>>>> already implemented >>>>>> in RexxFile (without the need to CHANGE the 'calling program') >>>>>> >>>>>> Also, the '/' may now be used as a GENRIC File-separator >>>>>> (translated to '\' in the >>>>>> Windows case...) >>>>>> >>>>>> Questions: >>>>>> >>>>>> 1.) What do you suggest as the proper syntax for the LIBRARY >>>>>> Name >>>>>> preceeding >>>>>> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >>>>>> >>>>>> 2.) Does anyone of you have a (small) example how I can >>>>>> read/write >>>>>> the LINES >>>>>> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >>>>>> >>>>>> Tom. >>>>>> >>>>>> PS: I already got from Walter Pachl some (very old & very good) >>>>>> examples >>>>>> how to read an IBM PDS File thru EXECIO. >>>>>> >>>>>> I am currently testing my own implementation of EXECIO for >>>>>> Rexx2Nrx. >>>>>> Thomas Schneider. >>>>>> >>>>>> _______________________________________________ >>>>>> Ibm-netrexx mailing list >>>>>> [hidden email] <mailto:[hidden email]> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Saludos / Regards, >>>>>> David Requena >>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Ibm-netrexx mailing list >>>>>> [hidden email] >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Ibm-netrexx mailing list >>>>> [hidden email] >>>>> >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Ibm-netrexx mailing list >>>> [hidden email] >>>> >>> ------------------------------------------------------------------------ >>> >>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > -------------- next part -------------- /**********************************************************************/ /* Options: generalized PP Options module */ /* (c) Th. Schneider, May 2002 */ /**********************************************************************/ /* 16.11.2003: options now moved to RUNTIME-package, as the various */ /* : options are used for Instance by External etc */ /**********************************************************************/ /* 07.10.2002: option 'PRO=pp_project' implemented:needed for Global */ /* 13.10.2002: opt_load and opt_use now 1 by default */ /* : trace_args added (for COB2RWPP) */ /* : NOPAUSE is the default now */ /* 17.05.2003: trace_items added */ /* 24.07.2003: opt_source=1 by default agaIn (TEST Rexx2Nrx 5.00) */ /* 01.09.2003: opt_GERMAN implemented, opt_CMD=1 by default */ /* 15.09.2003: opt_MAP implemented (display MAPS at end of parse) */ /* 02.10.2003: log_by_module (option LBM) implemented */ /* : default log-file is still PP.log */ /* 17.10.2003: option RESERVED implemented (reserved words as ID's */ /* : allowed In REXX by default */ /* 20.10.2003: option trace_use (TU) implemented (In External.nrx) */ /* 03.11.2003: opt_quiet implemented (corrected) */ /* 04.11.2003: opt_ANSII for ANSII standard compliance implemented */ /* 09.11.2003: opt_SHELL implemented */ /* 13.12.2003: note that the _in_Option routine is included In Params*/ /* 01.01.2004: set_pp_options moved from Params to Options, as */ /* : NetRexx uses clause does not work correctly */ /* : option 'TRV' (trace Resolve) added */ /* : option 'TBN' (trace builtin) added */ /* 18.02.2004: pp_project added */ /* 27.06.2004: build 'XREF' by default */ /* : new option FILEDIR */ /* : new option TOPCODES (trace_opcodes) */ /* : new option METRICS (display program metrics) */ /* : new options SCAN, PARSE, ANALYSE, GENERATE, EXEC */ /**********************************************************************/ options binary package Rey.RT import Rey.RT.ReyMsg import Rey.RT.External class Options public uses ReyMsg, External /*trace methods*/ properties public static options_initialized=boolean 0 /* ... Declare Global Switches */ /* 09.09.2008: new options LOWER and UPPER for target name conversions */ opt_lowercase=boolean 1 /* default is now Lowercase names */ opt_uppercase=boolean 0 /* and NO upper case conversion */ opt_scan = boolean 0 /* 1 = SCAN only */ opt_parse = boolean 0 /* 1 = PARSE only */ opt_analyse = boolean 0 /* 1 = ANALYSE only */ opt_generate = boolean 0 /* 1 = GENERATE ONLY */ opt_metrics = boolean 0 /* 1 = Display program Metrics (after SCAN & PARSE) */ opt_exec = boolean 0 /* 1 = EXEC only */ statement_debug=boolean 0 trace_builtin= boolean 0 /* 1= trace builtin Functions as well */ opt_filedir = boolean 0 /* 1 = change components of name to directories */ opt_file = Rexx '' /* may be 'DIR' or 'FILE' */ opt_debug = 0 /* 1 = force OPTION DEBUG */ opt_quiet=0 /* 1 quiet messages to LOG file only ... */ opt_banner = boolean 1 /* copy banner from source to target */ opt_xref=boolean 1 /* build xref by default */ class_by_module = boolean 0 log_by_module = boolean 0 dates_by_module = boolean 0 doit_by_module = boolean 0 opt_CORE = boolean 0 opt_SHELL = boolean 0 opt_ANSII = boolean 0 opt_reserved = boolean 0 opt_MAP = boolean 0 money_by_module = boolean 0 build_uref = boolean 0 opt_comment = boolean 0 opt_GERMAN = boolean 0 opt_MFC = boolean 0 opt_save = boolean 0 opt_note = boolean 1 opt_RTP = boolean 1 opt_BIF = boolean 1 opt_USE = boolean 1 opt_CMD = boolean 1 opt_load = boolean 1 opt_auto_add = boolean 1 opt_localize = boolean 0 opt_explicit = boolean 1 parsing_replacements = boolean 0 change_attributes = boolean 1 opt_package = boolean 1 opt_build = boolean 0 opt_list = boolean 0 opt_long_strings = boolean 0 opt_long_note = boolean 0 opt_short = boolean 0 opt_long = boolean 0 opt_type = boolean 1 opt_attention = boolean 1 opt_Stack = boolean 0 only_rexx = boolean 0 opt_symbolic = boolean 0 opt_source = boolean 1 opt_format = boolean 1 opt_binary = boolean 0 opt_logo = boolean 1 opt_time = boolean 0 -- /* 1 = display detailed timings */ opt_strictassign = boolean 0 opt_strictcase = boolean 0 opt_stats = boolean 0 opt_all_money = boolean 0 warn_missing = boolean 1 opt_test = boolean 0 opt_check = boolean 1 opt_RW = boolean 0 opt_nest = boolean 0 save_doc = boolean 0 trace_opcodes = boolean 0 trace_expose = boolean 0 trace_resolve = boolean 0 /* release 5.00 */ trace_use = boolean 0 trace_items = boolean 0 trace_args = boolean 0 trace_labels = boolean 0 trace_recursion = boolean 0 trace_code = boolean 0 trace_analyser = boolean 0 trace_in = boolean 0 trace_include = boolean 0 trace_tokens = boolean 0 trace_out = boolean 0 trace_value = boolean 0 trace_defs = boolean 0 trace_class = boolean 0 trace_assign = boolean 0 trace_funcs = boolean 0 trace_call = boolean 0 trace_nest = boolean 0 trace_templ = boolean 0 trace_hash = boolean 0 debug_defs = boolean 0 debug_scan = boolean 0 trace_copy = boolean 0 trace_parse = boolean 0 trace_line = boolean 0 trace_verbs = boolean 0 trace_decl = boolean 0 trace_date = boolean 0 debug_date = boolean 0 trace_source = boolean 0 trace_cond = boolean 0 trace_expr = boolean 0 trace_item = boolean 0 trace_checks = boolean 0 trace_flags = boolean 0 trace_perform = boolean 0 trace_exec = boolean 0 trace_replace = boolean 0 trace_money = boolean 0 trace_infect = boolean 0 debug_Infect = boolean 0 trace_para = boolean 0 trace_record = boolean 0 exec_trafo = boolean 1 debug_replace = boolean 0 debug_Global = boolean 0 debug_money = boolean 0 opt_cob122 = boolean 0 debug_RW_gen = boolean 0 opt_CICS = boolean 0 process_money = boolean 0 process_date = boolean 0 trace_phrase = boolean 0 trace_func_defs = boolean 0 trace_func_refs = boolean 0 trace_convert = boolean 0 trace_generator = boolean 0 debug_cics = boolean 0 debug_xref = boolean 0 flag1 = boolean 0 IO_method = int 3 optimize = boolean 0 opt_pack = boolean 0 opt_crossref = boolean 0 opt_used = boolean 0 opt_hash = boolean 0 master = boolean 0 save_code = boolean 1 opts_initialized = boolean 1 method init private static return method init_options() static public ; init() opts_initialized=1 return method use_options() static public if \opts_initialized then init_options return method set_pp_options(opt_params = Rexx) static public ; /* param must be REXX, as words etc is used */ opt_params=opt_params.upper() -- info('set_pp_options:' opt_params) if Rey.RT.ReyMsg.line_no > 0 & opt_verbose > 3 then do Rey.RT.ReyMsg.infol('executIng PP option:'||opt_params) end--if loop iw_option = 1 to opt_params.words() opt0 = opt_params.word(iw_option) if opt0.pos('=') > 0 then do parse opt0 opt1 '=' val1 flag1 = 0 if val1 = 'ON' then do flag1 = 1 end--if if val1 = 'OFF' then do flag1 = 0 end--if end else do if opt0.substr(1, 2) = 'NO' then do opt1 = opt0.substr(3) flag1 = 0 end else do opt1 = opt0 flag1 = 1 end--if val1 = flag1 /* call info 'set PP-options: opt1='opt1 'val1=' val1 */ end--if opt1=opt1.upper -- needed for select case select case opt1 /* new options LOWER and UPPER for Name conversions */ when 'LOWER' then do opt_lowercase=flag1 opt_uppercase=\flag1 end when 'UPPER' then do opt_lowercase=\flag1 opt_uppercase=flag1 end when 'SCAN' then opt_scan=flag1 when 'PARSE' then opt_parse=flag1 when 'ANALYSE' then opt_analyse=flag1 when 'GENERATE' then opt_generate=flag1 when 'EXEC' then opt_exec=flag1 when 'METRICS' then opt_metrics=flag1 /* release 5.00*/ when 'BANNER' then opt_banner = flag1 /* release 5.00 */ when 'TBN' then trace_builtin = flag1 /* release 5.00 */ when 'TRV' then trace_resolve = flag1 /* release 5.00 */ /* new NetRexx & Java options */ when 'PRO','PROJECT' then do if val1 = 1 then do val1 = Rexx(opt_params).word(iw_option + 1) iw_option = iw_option + 1 end--if Global.set_project(val1) end--when when 'LNOTE' then opt_long_note = flag1 when 'CORE' then do opt_CORE = flag1 end--when when 'SHELL' then do opt_SHELL = flag1 end--when when 'ANSII' then do opt_ANSII = flag1 end--when when 'TU' then do trace_use = flag1 end--when when 'TARGS' then do trace_args = flag1 end--when when 'TOPCODES' then trace_opcodes=flag1 when 'RESERVED' then do opt_reserved = flag1 end--when when 'LBM' then do log_by_module = flag1 end--when when 'MAP' then do opt_MAP = flag1 end--when when 'GERMAN' then do opt_GERMAN = flag1 end--when when 'RTP' then do opt_RTP = flag1 end--when when 'BIF' then do opt_BIF = flag1 end--when when 'USE' then do opt_USE = flag1 end--when when 'CMD' then do opt_CMD = flag1 end--when when 'LOCALIZE' then do opt_localize = flag1 end--when when 'LOAD' then do opt_load = flag1 end--when when 'EXPLICIT' then do opt_explicit = flag1 end--when when 'BUILD' then do opt_build = flag1 end--when when 'PACKAGE' then do opt_package = flag1 end--when when 'Lstring' then do opt_long_strings = flag1 end--when when 'IO1' then do IO_method = 1 end--when when 'IO2' then do IO_method = 2 end--when when 'IO3' then do IO_method = 3 end--when when 'OPTIMIZE' then do optimize = flag1 end--when when 'TYPE' then do opt_type = flag1 end--when when 'SHORT' then do opt_short = flag1 end--when when 'LONG' then do opt_long = flag1 end--when when 'XREF' then do opt_xref = flag1 end--when when 'STACK' then do opt_Stack = flag1 end--when when 'LOGO' then do opt_logo = flag1 end--when when 'REXX' then do only_rexx = flag1 end--when when 'VERBOSE0' then do Rey.RT.ReyMsg.opt_verbose = 0 end--when when 'VERBOSE1' then do Rey.RT.ReyMsg.opt_verbose = 1 end--when when 'VERBOSE2' then do Rey.RT.ReyMsg.opt_verbose = 2 end--when when 'VERBOSE3' then do Rey.RT.ReyMsg.opt_verbose = 3 end--when when 'VERBOSE4' then do Rey.RT.ReyMsg.opt_verbose = 4 end--when when 'VERBOSE5' then do Rey.RT.ReyMsg.opt_verbose = 5 end--when when 'STRICTASSIGN' then do opt_strictassign = flag1 end--when when 'STRICTCASE' then do opt_strictcase = flag1 end--when when 'TIME' then do opt_time = flag1 end--when when 'binary' then do opt_binary = flag1 end--when when 'PAUSE' then do Rey.RT.ReyMsg.opt_pause = flag1 end--when when 'STATS' then do opt_stats = flag1 /* my own parser options */ end--when when 'SOURCE' then do opt_source = flag1 end--when when 'FORMAT' then do opt_format = flag1 end--when when 'TCODE' then do trace_code = flag1 end--when when 'TT' then do trace_tokens = flag1 end--when when 'TGEN' then do trace_generator = flag1 end--when when 'TTEMPL' then do trace_templ = flag1 end--when when 'SYMBOLIC' then do opt_symbolic = flag1 end--when when 'PACK' then do opt_pack = flag1 end--when when 'WARN' then do Rey.RT.ReyMsg.opt_warn = flag1 end--when when 'ATTENTION' then do opt_attention = flag1 end--when when 'CROSSREF' then do opt_crossref = flag1 end--when when 'NEST' then do opt_nest = flag1 end--when when 'CICS' then do opt_CICS = flag1 end--when when 'TEST' then do opt_test = flag1 end--when when 'USED' then do opt_used = flag1 end--when when 'HASH' then do opt_hash = flag1 end--when when 'ALL-MON' then do opt_all_money = flag1 end--when when 'LIST' then do opt_list = flag1 end--when when 'MASTER' then do master = flag1 end--when when 'DEBUG' then do ReyMsg.opt_debug = flag1 end--when when 'DS' then do statement_debug=flag1 end--when when 'DSCAN' then do debug_scan = 1 end--when when 'DC' then do debug_cics = flag1 end--when when 'DG' then do debug_Global = flag1 end--when when 'DDATE' then do debug_date = flag1 end--when when 'DM' then do debug_money = flag1 end--when when 'DR' then do debug_replace = flag1 end--when when 'SAVE' then do opt_save = flag1 end--when when 'SAVECODE' then do save_code = 1 end--when when 'QUIET' then do Rey.RT.ReyMsg.opt_quiet = flag1 end--when when 'TRACE' then do trace_in = flag1 end--when when 'TREC' then do trace_recursion = flag1 end--when when 'TH' then do trace_hash = flag1 end--when when 'TPHR' then do trace_phrase = flag1 end--when when 'TDATE' then do trace_date = flag1 end--when when 'TS' then do trace_source = flag1 end--when when 'TO' then do trace_out = flag1 end--when when 'TC' then do trace_cond = flag1 end--when when 'TCV' then do trace_convert = flag1 end--when when 'TCL' then do trace_class = flag1 end--when when 'TCOPY' then do trace_copy = flag1 end--when when 'TN','TNEST' then do trace_nest = flag1 end--when when 'TY' then do trace_checks = flag1 end--when when 'TE' then do trace_expr = flag1 end--when when 'TFL' then do trace_flags = flag1 end--when when 'TFU' then do trace_funcs = flag1 end--when when 'TFD' then do trace_func_defs = flag1 end--when when 'TFR' then do trace_func_refs = flag1 end--when when 'TI' then do trace_item = flag1 end--when when 'TInCL' then do trace_include = flag1 end--when when 'TL' then do trace_line = flag1 end--when when 'TLAB' then do trace_labels = flag1 end--when when 'TP' then do trace_perform = flag1 end--when when 'TA' then do trace_assign = flag1 end--when when 'TAN' then do trace_analyser = flag1 end--when when 'TD' then do trace_decl = flag1 end--when when 'TDEF' then do trace_defs = flag1 end--when when 'TV' then do trace_verbs = flag1 end--when when 'TVAL' then do trace_value = flag1 end--when when 'TX' then do External.trace_externals = flag1 end--when when 'TEXEC' then do trace_exec = flag1 end--when when 'TZ' then do trace_parse = flag1 end--when when 'TR' then do trace_replace = flag1 end--when when 'TM' then do trace_money = flag1 end--when otherwise do do if Rey.RT.ReyMsg.line_no > 0 then do end else do Rey.RT.ReyMsg.warning('unknown PP option: '||opt0 'ignored') end--if end end--otherwise end--select end--loop iw_option /* default dependecies of options */ if trace_items | trace_expr | trace_tokens | trace_verbs then do trace_source = 1 end--if if opt_binary then do opt_explicit = 1 end--if if trace_checks then do trace_date = 1 end--if if statement_debug then do trace_source = 1 end--if if trace_source then do opt_source = 1 end--if if \ opt_format then do opt_note = 0 end--if options_initialized=1 /* now the OPTIONS ARE initialized*/ return
Tom. (ths@db-123.com)
|
In reply to this post by David Requena
You are close to my idea. There is an undocumented option in
NetRexxScript to turn on "df" (the debug flag) - the option is only visible on the plugin options screen if you are running as account "dad". ;-) If not under that account, the option can be turned on/off via a script. Here is the debug.nrx script from the //useracct//.jedit/NetRexx directory: --------------------------------------------------------------------------------------------------------------------- -- This script turns the plugin debug flag on or off -- ***** warning - setting flag on can produce lots of log and other output trace results OPTION_PREFIX = String "options.netrexxscript." t=boolean 1 -- "true" f=boolean 0 -- "false" jEdit.setBooleanProperty(OPTION_PREFIX"debug",\jEdit.getBooleanProperty(OPTION_PREFIX"debug",f)) ---------------------------------------------------------------------------------------------------------------------- I guess that I was not confident the code was bulletproof yet, so I left in the option to trace most of the code in case unexpected problems might show up. It came in very handy in the development phases to limit the large volume of debug output to periods of looking at a specific bug! -- Kermit David Requena wrote: > Thomas, > > That is indeed a very valid point. > Thought of the possibility of activating debug mode on production code > by using some command line switch just after sending my previous email. > > Thanks, > David > > --- > Saludos / Kind regards. > David Requena > > > El 15/02/2010 13:44, Thomas Schneider escribi?: >> Hi David, >> I'm using a similar approach than Kermit, to have an OPTION to >> *Dynamically* force DEBUG. >> I'm rarely using TRACE, but I do have a lot of conditional debugs in >> my program, which I can even >> use in the PRODUCTION version just in case a not anticipated >> situation occurs in the program >> of a client. >> >> This is just for your info. >> >> Similarly, I do use a lot of assertions in my code, and did invent >> some special notation >> for those in my newer programs, e.g.: >> >> x=3 >> y=x ::= 3 >> >> where :: introduces an assertion, which is checked at run tyme (in >> this case, y MUST be 3) >> >> when it is NOT 3, an ASSERTION error message is given (and when not >> otherwise wanted, >> the program aborts immediately. >> >> Tom. >> ======================================================== >> Kermit, please give us the reson of cyour decision as well. >> >> David Requena schrieb: >>> Kermit, >>> >>> hmm.. got curious. I noticed the following on your supplied code >>> snipped: >>> >>> if df then trace results >>> >>> Here I'm supposing df is a property appropriately set up upstream as >>> needed. >>> >>> This is a construct I've used often in other languages but in >>> NetRexx I tend to use trace statements liberally as needed. Then for >>> production build I use 'options notrace' so no overhead is incurred. >>> >>> Any reason why would you prefer the conditional check over NetRexx' >>> options nobinary idiom? >>> >>> Maybe I'm being dumb but seems to me the conditional would be >>> carried to production code whereas options nobinary would eliminate >>> any trace (yeah, redundant) of trace code. >>> >>> --- >>> Saludos / Kind regards. >>> David Requena >>> >>> El 13/02/2010 8:16, Kermit Kiser escribi?: >>>> Thomas ; >>>> >>>> There was an exchange about reading Zip/Jar files on the list last >>>> month. I don't know if you were on the list then, so I am attaching >>>> it here. >>>> >>>> It sounds like you might be interested in the actual code to read >>>> the data also, so here it is: >>>> >>>> ------------------------------------------------------ general >>>> purpose routines >>>> ------------------------------------------------------- >>>> >>>> method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) >>>> -- method to copy a jarfile entry to a directory >>>> >>>> if df then trace results nrscript=scriptdir||fs||je.getName >>>> >>>> nrs=File(nrscript) >>>> >>>> if \nrs.exists then do >>>> >>>> rc=copyjarentrytofile(jf,je,nrs) >>>> >>>> if rc=1 then say je.getName "copied to:" scriptdir >>>> >>>> end >>>> >>>> method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) >>>> >>>> if df then trace results >>>> >>>> do >>>> >>>> scriptstream=jf.getInputStream(je) >>>> >>>> if Rexx(je.getName).pos(".class")=0 then do >>>> >>>> >>>> scriptreader=BufferedReader(InputStreamReader(scriptstream)) >>>> >>>> -- >>>> scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) >>>> >>>> scriptwriter=BufferedWriter(FileWriter(nrs)) >>>> >>>> copyfile(scriptreader,scriptwriter) >>>> >>>> scriptwriter.close >>>> >>>> end >>>> >>>> else do >>>> >>>> outstream=FileOutputStream(nrs) >>>> >>>> copybin(scriptstream,outstream) >>>> >>>> outstream.close >>>> >>>> end >>>> >>>> catch badguy=Exception >>>> >>>> say je.getName "copy error =" badguy >>>> >>>> return 0 >>>> >>>> end >>>> >>>> return 1 >>>> >>>> /* methods to copy a file: */ >>>> >>>> method >>>> copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) >>>> signals IOException >>>> >>>> if df then trace results >>>> >>>> line=ifq.readline >>>> >>>> if line = null then return >>>> >>>> ofq.write(string line,0,line.length) >>>> >>>> trace off >>>> >>>> loop forever >>>> >>>> line=ifq.readline >>>> >>>> if line = null then leave >>>> >>>> ofq.newline() >>>> >>>> ofq.write(string line,0,line.length) >>>> >>>> end method copybin(ifq=InputStream,ofq=OutputStream) >>>> binary signals IOException >>>> >>>> bite=ifq.read >>>> >>>> loop while bite \= -1 >>>> >>>> ofq.write(bite) >>>> >>>> bite=ifq.read >>>> >>>> end >>>> --------------------------------------------------------------------------------------------------------------------------------------------------- >>>> >>>> >>>> >>>> Kinda crude, but maybe it helps. >>>> >>>> note: fs=File.separator >>>> >>>> -- Kermit >>>> >>>> >>>> Thomas Schneider wrote: >>>>> Hi Divid, >>>>> .. many thanks for the Details. >>>>> ... MFC already said me the same thins! >>>>> >>>>> Isn't that (OUR) Universe ... >>>>> >>>>> ..... a UNIQUE thing ?? >>>>> Thomas. >>>>> ... will read your message (below) tomorrow in more detail. >>>>> = Did archive it now, I'm gooing a'sleeeeep ... >>>>> ================================================================= >>>>> David Requena schrieb: >>>>>> Thomas, >>>>>> >>>>>> ZIP and JAR are the same thing. >>>>>> >>>>>> There is standard stuff in the java library for manipulating this >>>>>> format. >>>>>> Look at the package java.util.zip classes. >>>>>> >>>>>> David >>>>>> >>>>>> 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> >>>>>> >>>>>> Hi there again, >>>>>> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >>>>>> second, I would like to enhance my FILE-Access routines >>>>>> (current >>>>>> doc in \Rexx2RT\RexxFile >>>>>> (in the Run-Time package of www.Rexx2Nrx.com >>>>>> <http://www.Rexx2Nrx.com> since years) to do the following: >>>>>> >>>>>> -- using a special (computer independent) Syntax to read 'the >>>>>> members of: >>>>>> >>>>>> -- a JAR File >>>>>> -- a ZIP File >>>>>> -- an IBM zOS PDS file >>>>>> >>>>>> ON demand (e.g. to use linein, lineout, and all the other things >>>>>> already implemented >>>>>> in RexxFile (without the need to CHANGE the 'calling program') >>>>>> >>>>>> Also, the '/' may now be used as a GENRIC File-separator >>>>>> (translated to '\' in the >>>>>> Windows case...) >>>>>> >>>>>> Questions: >>>>>> >>>>>> 1.) What do you suggest as the proper syntax for the LIBRARY >>>>>> Name >>>>>> preceeding >>>>>> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >>>>>> >>>>>> 2.) Does anyone of you have a (small) example how I can >>>>>> read/write >>>>>> the LINES >>>>>> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >>>>>> >>>>>> Tom. >>>>>> >>>>>> PS: I already got from Walter Pachl some (very old & very good) >>>>>> examples >>>>>> how to read an IBM PDS File thru EXECIO. >>>>>> >>>>>> I am currently testing my own implementation of EXECIO for >>>>>> Rexx2Nrx. >>>>>> Thomas Schneider. >>>>>> >>>>>> _______________________________________________ >>>>>> Ibm-netrexx mailing list >>>>>> [hidden email] <mailto:[hidden email]> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Saludos / Regards, >>>>>> David Requena >>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Ibm-netrexx mailing list >>>>>> [hidden email] >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Ibm-netrexx mailing list >>>>> [hidden email] >>>>> >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Ibm-netrexx mailing list >>>> [hidden email] >>>> >>> ------------------------------------------------------------------------ >>> >>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > > An HTML attachment was scrubbed... URL: http://ns.hursley.ibm.com/pipermail/ibm-netrexx/attachments/20100215/ed3b6db5/attachment-0001.html |
Didn't know that up to now.... sorry :-(
Great, thanks for the info. Tom. ============================================================================= Kermit Kiser schrieb: > You are close to my idea. There is an undocumented option in > NetRexxScript to turn on "df" (the debug flag) - the option is only > visible on the plugin options screen if you are running as account > "dad". ;-) If not under that account, the option can be turned on/off > via a script. Here is the debug.nrx script from the > //useracct//.jedit/NetRexx directory: > > --------------------------------------------------------------------------------------------------------------------- > > -- This script turns the plugin debug flag on or off > -- ***** warning - setting flag on can produce lots of log and other > output > > trace results > > OPTION_PREFIX = String "options.netrexxscript." > t=boolean 1 -- "true" > f=boolean 0 -- "false" > > > jEdit.setBooleanProperty(OPTION_PREFIX"debug",\jEdit.getBooleanProperty(OPTION_PREFIX"debug",f)) > > ---------------------------------------------------------------------------------------------------------------------- > > I guess that I was not confident the code was bulletproof yet, so I > left in the option to trace most of the code in case unexpected > problems might show up. It came in very handy in the development > phases to limit the large volume of debug output to periods of looking > at a specific bug! > > -- Kermit > > > David Requena wrote: >> Thomas, >> >> That is indeed a very valid point. >> Thought of the possibility of activating debug mode on production >> code by using some command line switch just after sending my previous >> email. >> >> Thanks, >> David >> >> --- >> Saludos / Kind regards. >> David Requena >> >> >> El 15/02/2010 13:44, Thomas Schneider escribi?: >>> Hi David, >>> I'm using a similar approach than Kermit, to have an OPTION to >>> *Dynamically* force DEBUG. >>> I'm rarely using TRACE, but I do have a lot of conditional debugs in >>> my program, which I can even >>> use in the PRODUCTION version just in case a not anticipated >>> situation occurs in the program >>> of a client. >>> >>> This is just for your info. >>> >>> Similarly, I do use a lot of assertions in my code, and did invent >>> some special notation >>> for those in my newer programs, e.g.: >>> >>> x=3 >>> y=x ::= 3 >>> >>> where :: introduces an assertion, which is checked at run tyme (in >>> this case, y MUST be 3) >>> >>> when it is NOT 3, an ASSERTION error message is given (and when not >>> otherwise wanted, >>> the program aborts immediately. >>> >>> Tom. >>> ======================================================== >>> Kermit, please give us the reson of cyour decision as well. >>> >>> David Requena schrieb: >>>> Kermit, >>>> >>>> hmm.. got curious. I noticed the following on your supplied code >>>> snipped: >>>> >>>> if df then trace results >>>> >>>> Here I'm supposing df is a property appropriately set up upstream >>>> as needed. >>>> >>>> This is a construct I've used often in other languages but in >>>> NetRexx I tend to use trace statements liberally as needed. Then >>>> for production build I use 'options notrace' so no overhead is >>>> incurred. >>>> >>>> Any reason why would you prefer the conditional check over NetRexx' >>>> options nobinary idiom? >>>> >>>> Maybe I'm being dumb but seems to me the conditional would be >>>> carried to production code whereas options nobinary would eliminate >>>> any trace (yeah, redundant) of trace code. >>>> >>>> --- >>>> Saludos / Kind regards. >>>> David Requena >>>> >>>> El 13/02/2010 8:16, Kermit Kiser escribi?: >>>>> Thomas ; >>>>> >>>>> There was an exchange about reading Zip/Jar files on the list last >>>>> month. I don't know if you were on the list then, so I am >>>>> attaching it here. >>>>> >>>>> It sounds like you might be interested in the actual code to read >>>>> the data also, so here it is: >>>>> >>>>> ------------------------------------------------------ general >>>>> purpose routines >>>>> ------------------------------------------------------- >>>>> >>>>> method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) >>>>> -- method to copy a jarfile entry to a directory >>>>> >>>>> if df then trace results nrscript=scriptdir||fs||je.getName >>>>> >>>>> nrs=File(nrscript) >>>>> >>>>> if \nrs.exists then do >>>>> >>>>> rc=copyjarentrytofile(jf,je,nrs) >>>>> >>>>> if rc=1 then say je.getName "copied to:" scriptdir >>>>> >>>>> end >>>>> >>>>> method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) >>>>> >>>>> if df then trace results >>>>> >>>>> do >>>>> >>>>> scriptstream=jf.getInputStream(je) >>>>> >>>>> if Rexx(je.getName).pos(".class")=0 then do >>>>> >>>>> >>>>> scriptreader=BufferedReader(InputStreamReader(scriptstream)) >>>>> >>>>> -- >>>>> scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) >>>>> >>>>> scriptwriter=BufferedWriter(FileWriter(nrs)) >>>>> >>>>> copyfile(scriptreader,scriptwriter) >>>>> >>>>> scriptwriter.close >>>>> >>>>> end >>>>> >>>>> else do >>>>> >>>>> outstream=FileOutputStream(nrs) >>>>> >>>>> copybin(scriptstream,outstream) >>>>> >>>>> outstream.close >>>>> >>>>> end >>>>> >>>>> catch badguy=Exception >>>>> >>>>> say je.getName "copy error =" badguy >>>>> >>>>> return 0 >>>>> >>>>> end >>>>> >>>>> return 1 >>>>> >>>>> /* methods to copy a file: */ >>>>> >>>>> method >>>>> copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) >>>>> signals IOException >>>>> >>>>> if df then trace results >>>>> >>>>> line=ifq.readline >>>>> >>>>> if line = null then return >>>>> >>>>> ofq.write(string line,0,line.length) >>>>> >>>>> trace off >>>>> >>>>> loop forever >>>>> >>>>> line=ifq.readline >>>>> >>>>> if line = null then leave >>>>> >>>>> ofq.newline() >>>>> >>>>> ofq.write(string line,0,line.length) >>>>> >>>>> end method copybin(ifq=InputStream,ofq=OutputStream) >>>>> binary signals IOException >>>>> >>>>> bite=ifq.read >>>>> >>>>> loop while bite \= -1 >>>>> >>>>> ofq.write(bite) >>>>> >>>>> bite=ifq.read >>>>> >>>>> end >>>>> --------------------------------------------------------------------------------------------------------------------------------------------------- >>>>> >>>>> >>>>> >>>>> Kinda crude, but maybe it helps. >>>>> >>>>> note: fs=File.separator >>>>> >>>>> -- Kermit >>>>> >>>>> >>>>> Thomas Schneider wrote: >>>>>> Hi Divid, >>>>>> .. many thanks for the Details. >>>>>> ... MFC already said me the same thins! >>>>>> >>>>>> Isn't that (OUR) Universe ... >>>>>> >>>>>> ..... a UNIQUE thing ?? >>>>>> Thomas. >>>>>> ... will read your message (below) tomorrow in more detail. >>>>>> = Did archive it now, I'm gooing a'sleeeeep ... >>>>>> ================================================================= >>>>>> David Requena schrieb: >>>>>>> Thomas, >>>>>>> >>>>>>> ZIP and JAR are the same thing. >>>>>>> >>>>>>> There is standard stuff in the java library for manipulating >>>>>>> this format. >>>>>>> Look at the package java.util.zip classes. >>>>>>> >>>>>>> David >>>>>>> >>>>>>> 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> >>>>>>> >>>>>>> Hi there again, >>>>>>> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >>>>>>> second, I would like to enhance my FILE-Access routines >>>>>>> (current >>>>>>> doc in \Rexx2RT\RexxFile >>>>>>> (in the Run-Time package of www.Rexx2Nrx.com >>>>>>> <http://www.Rexx2Nrx.com> since years) to do the following: >>>>>>> >>>>>>> -- using a special (computer independent) Syntax to read 'the >>>>>>> members of: >>>>>>> >>>>>>> -- a JAR File >>>>>>> -- a ZIP File >>>>>>> -- an IBM zOS PDS file >>>>>>> >>>>>>> ON demand (e.g. to use linein, lineout, and all the other >>>>>>> things >>>>>>> already implemented >>>>>>> in RexxFile (without the need to CHANGE the 'calling program') >>>>>>> >>>>>>> Also, the '/' may now be used as a GENRIC File-separator >>>>>>> (translated to '\' in the >>>>>>> Windows case...) >>>>>>> >>>>>>> Questions: >>>>>>> >>>>>>> 1.) What do you suggest as the proper syntax for the LIBRARY >>>>>>> Name >>>>>>> preceeding >>>>>>> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >>>>>>> >>>>>>> 2.) Does anyone of you have a (small) example how I can >>>>>>> read/write >>>>>>> the LINES >>>>>>> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >>>>>>> >>>>>>> Tom. >>>>>>> >>>>>>> PS: I already got from Walter Pachl some (very old & very good) >>>>>>> examples >>>>>>> how to read an IBM PDS File thru EXECIO. >>>>>>> >>>>>>> I am currently testing my own implementation of EXECIO for >>>>>>> Rexx2Nrx. >>>>>>> Thomas Schneider. >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Ibm-netrexx mailing list >>>>>>> [hidden email] >>>>>>> <mailto:[hidden email]> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Saludos / Regards, >>>>>>> David Requena >>>>>>> >>>>>>> ------------------------------------------------------------------------ >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Ibm-netrexx mailing list >>>>>>> [hidden email] >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Ibm-netrexx mailing list >>>>>> [hidden email] >>>>>> >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Ibm-netrexx mailing list >>>>> [hidden email] >>>>> >>>> ------------------------------------------------------------------------ >>>> >>>> >>>> _______________________________________________ >>>> Ibm-netrexx mailing list >>>> [hidden email] >>>> >>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> >> >> > ------------------------------------------------------------------------ > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > >
Tom. (ths@db-123.com)
|
In reply to this post by Kermit Kiser
Kermit,
Yes, I see. It is in fact a very similar pattern to what I've used often when working with big Lostusscript programs in products like Lotus Workfow, where you could attach the debugger. I guess I jumped too fast on that one without really thinking much about what I was actually going to ask.Or in other words: yes, I was being dumb :-) According to the language definition 1.00: "In some implementations, the use of trace instructions may substantially increase the size of classes and the execution time of methods affected by tracing." I wonder how much that increase might be. To be honest I always assumed that if it was big enough to be mentioned in the docs, it must be quite significant. --- Saludos / Kind regards. David Requena El 15/02/2010 17:18, Kermit Kiser escribi?: > You are close to my idea. There is an undocumented option in > NetRexxScript to turn on "df" (the debug flag) - the option is only > visible on the plugin options screen if you are running as account > "dad". ;-) If not under that account, the option can be turned on/off > via a script. Here is the debug.nrx script from the > //useracct//.jedit/NetRexx directory: > > --------------------------------------------------------------------------------------------------------------------- > > -- This script turns the plugin debug flag on or off > -- ***** warning - setting flag on can produce lots of log and other > output > > trace results > > OPTION_PREFIX = String "options.netrexxscript." > t=boolean 1 -- "true" > f=boolean 0 -- "false" > > > jEdit.setBooleanProperty(OPTION_PREFIX"debug",\jEdit.getBooleanProperty(OPTION_PREFIX"debug",f)) > > ---------------------------------------------------------------------------------------------------------------------- > > I guess that I was not confident the code was bulletproof yet, so I > left in the option to trace most of the code in case unexpected > problems might show up. It came in very handy in the development > phases to limit the large volume of debug output to periods of looking > at a specific bug! > > -- Kermit > > > David Requena wrote: >> Thomas, >> >> That is indeed a very valid point. >> Thought of the possibility of activating debug mode on production >> code by using some command line switch just after sending my previous >> email. >> >> Thanks, >> David >> >> --- >> Saludos / Kind regards. >> David Requena >> >> >> El 15/02/2010 13:44, Thomas Schneider escribi?: >>> Hi David, >>> I'm using a similar approach than Kermit, to have an OPTION to >>> *Dynamically* force DEBUG. >>> I'm rarely using TRACE, but I do have a lot of conditional debugs in >>> my program, which I can even >>> use in the PRODUCTION version just in case a not anticipated >>> situation occurs in the program >>> of a client. >>> >>> This is just for your info. >>> >>> Similarly, I do use a lot of assertions in my code, and did invent >>> some special notation >>> for those in my newer programs, e.g.: >>> >>> x=3 >>> y=x ::= 3 >>> >>> where :: introduces an assertion, which is checked at run tyme (in >>> this case, y MUST be 3) >>> >>> when it is NOT 3, an ASSERTION error message is given (and when not >>> otherwise wanted, >>> the program aborts immediately. >>> >>> Tom. >>> ======================================================== >>> Kermit, please give us the reson of cyour decision as well. >>> >>> David Requena schrieb: >>>> Kermit, >>>> >>>> hmm.. got curious. I noticed the following on your supplied code >>>> snipped: >>>> >>>> if df then trace results >>>> >>>> Here I'm supposing df is a property appropriately set up upstream >>>> as needed. >>>> >>>> This is a construct I've used often in other languages but in >>>> NetRexx I tend to use trace statements liberally as needed. Then >>>> for production build I use 'options notrace' so no overhead is >>>> incurred. >>>> >>>> Any reason why would you prefer the conditional check over NetRexx' >>>> options nobinary idiom? >>>> >>>> Maybe I'm being dumb but seems to me the conditional would be >>>> carried to production code whereas options nobinary would eliminate >>>> any trace (yeah, redundant) of trace code. >>>> >>>> --- >>>> Saludos / Kind regards. >>>> David Requena >>>> >>>> El 13/02/2010 8:16, Kermit Kiser escribi?: >>>>> Thomas ; >>>>> >>>>> There was an exchange about reading Zip/Jar files on the list last >>>>> month. I don't know if you were on the list then, so I am >>>>> attaching it here. >>>>> >>>>> It sounds like you might be interested in the actual code to read >>>>> the data also, so here it is: >>>>> >>>>> ------------------------------------------------------ general >>>>> purpose routines >>>>> ------------------------------------------------------- >>>>> >>>>> method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) >>>>> -- method to copy a jarfile entry to a directory >>>>> >>>>> if df then trace results nrscript=scriptdir||fs||je.getName >>>>> >>>>> nrs=File(nrscript) >>>>> >>>>> if \nrs.exists then do >>>>> >>>>> rc=copyjarentrytofile(jf,je,nrs) >>>>> >>>>> if rc=1 then say je.getName "copied to:" scriptdir >>>>> >>>>> end >>>>> >>>>> method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) >>>>> >>>>> if df then trace results >>>>> >>>>> do >>>>> >>>>> scriptstream=jf.getInputStream(je) >>>>> >>>>> if Rexx(je.getName).pos(".class")=0 then do >>>>> >>>>> >>>>> scriptreader=BufferedReader(InputStreamReader(scriptstream)) >>>>> >>>>> -- >>>>> scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) >>>>> >>>>> scriptwriter=BufferedWriter(FileWriter(nrs)) >>>>> >>>>> copyfile(scriptreader,scriptwriter) >>>>> >>>>> scriptwriter.close >>>>> >>>>> end >>>>> >>>>> else do >>>>> >>>>> outstream=FileOutputStream(nrs) >>>>> >>>>> copybin(scriptstream,outstream) >>>>> >>>>> outstream.close >>>>> >>>>> end >>>>> >>>>> catch badguy=Exception >>>>> >>>>> say je.getName "copy error =" badguy >>>>> >>>>> return 0 >>>>> >>>>> end >>>>> >>>>> return 1 >>>>> >>>>> /* methods to copy a file: */ >>>>> >>>>> method >>>>> copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) >>>>> signals IOException >>>>> >>>>> if df then trace results >>>>> >>>>> line=ifq.readline >>>>> >>>>> if line = null then return >>>>> >>>>> ofq.write(string line,0,line.length) >>>>> >>>>> trace off >>>>> >>>>> loop forever >>>>> >>>>> line=ifq.readline >>>>> >>>>> if line = null then leave >>>>> >>>>> ofq.newline() >>>>> >>>>> ofq.write(string line,0,line.length) >>>>> >>>>> end method copybin(ifq=InputStream,ofq=OutputStream) >>>>> binary signals IOException >>>>> >>>>> bite=ifq.read >>>>> >>>>> loop while bite \= -1 >>>>> >>>>> ofq.write(bite) >>>>> >>>>> bite=ifq.read >>>>> >>>>> end >>>>> --------------------------------------------------------------------------------------------------------------------------------------------------- >>>>> >>>>> >>>>> >>>>> Kinda crude, but maybe it helps. >>>>> >>>>> note: fs=File.separator >>>>> >>>>> -- Kermit >>>>> >>>>> >>>>> Thomas Schneider wrote: >>>>>> Hi Divid, >>>>>> .. many thanks for the Details. >>>>>> ... MFC already said me the same thins! >>>>>> >>>>>> Isn't that (OUR) Universe ... >>>>>> >>>>>> ..... a UNIQUE thing ?? >>>>>> Thomas. >>>>>> ... will read your message (below) tomorrow in more detail. >>>>>> = Did archive it now, I'm gooing a'sleeeeep ... >>>>>> ================================================================= >>>>>> David Requena schrieb: >>>>>>> Thomas, >>>>>>> >>>>>>> ZIP and JAR are the same thing. >>>>>>> >>>>>>> There is standard stuff in the java library for manipulating >>>>>>> this format. >>>>>>> Look at the package java.util.zip classes. >>>>>>> >>>>>>> David >>>>>>> >>>>>>> 2010/2/12 Thomas Schneider <[hidden email] <mailto:[hidden email]>> >>>>>>> >>>>>>> Hi there again, >>>>>>> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >>>>>>> second, I would like to enhance my FILE-Access routines >>>>>>> (current >>>>>>> doc in \Rexx2RT\RexxFile >>>>>>> (in the Run-Time package of www.Rexx2Nrx.com >>>>>>> <http://www.Rexx2Nrx.com> since years) to do the following: >>>>>>> >>>>>>> -- using a special (computer independent) Syntax to read 'the >>>>>>> members of: >>>>>>> >>>>>>> -- a JAR File >>>>>>> -- a ZIP File >>>>>>> -- an IBM zOS PDS file >>>>>>> >>>>>>> ON demand (e.g. to use linein, lineout, and all the other >>>>>>> things >>>>>>> already implemented >>>>>>> in RexxFile (without the need to CHANGE the 'calling program') >>>>>>> >>>>>>> Also, the '/' may now be used as a GENRIC File-separator >>>>>>> (translated to '\' in the >>>>>>> Windows case...) >>>>>>> >>>>>>> Questions: >>>>>>> >>>>>>> 1.) What do you suggest as the proper syntax for the LIBRARY >>>>>>> Name >>>>>>> preceeding >>>>>>> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >>>>>>> >>>>>>> 2.) Does anyone of you have a (small) example how I can >>>>>>> read/write >>>>>>> the LINES >>>>>>> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >>>>>>> >>>>>>> Tom. >>>>>>> >>>>>>> PS: I already got from Walter Pachl some (very old & very good) >>>>>>> examples >>>>>>> how to read an IBM PDS File thru EXECIO. >>>>>>> >>>>>>> I am currently testing my own implementation of EXECIO for >>>>>>> Rexx2Nrx. >>>>>>> Thomas Schneider. >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Ibm-netrexx mailing list >>>>>>> [hidden email] <mailto:[hidden email]> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Saludos / Regards, >>>>>>> David Requena >>>>>>> >>>>>>> ------------------------------------------------------------------------ >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Ibm-netrexx mailing list >>>>>>> [hidden email] >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Ibm-netrexx mailing list >>>>>> [hidden email] >>>>>> >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Ibm-netrexx mailing list >>>>> [hidden email] >>>>> >>>> ------------------------------------------------------------------------ >>>> >>>> >>>> _______________________________________________ >>>> Ibm-netrexx mailing list >>>> [hidden email] >>>> >>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> >> >> > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > An HTML attachment was scrubbed... URL: http://ns.hursley.ibm.com/pipermail/ibm-netrexx/attachments/20100215/aecdb213/attachment-0001.html |
According to the language definition 1.00:
"In some implementations, the use of trace instructions may substantially increase the size of classes and the execution time of methods affected by tracing." I wonder how much that increase might be. To be honest I always assumed that if it was big enough to be mentioned in the docs, it must be quite significant. Yes .. the code to generate the traces has to be in place (unless turned off by the options/compile-time flag). To decide whether that's significant or not, in your context, choose a reasonably large class, and compile it. Observe the size of the class file. Next, add a trace statement at the top of the class -- again compile and observe the resulting size. This will vary depening on the trace option, of course, so several variations would be interesting. (Report back here?) Size of class might not matter too much nowadays, although it will slow down loading. But worth being aware of it. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ns.hursley.ibm.com/pipermail/ibm-netrexx/attachments/20100215/601158a3/attachment.html |
In reply to this post by David Requena
Hi David, Kermit, I did use (long time ago, say 6-7 years) look at Mike F. Cowlishaws generated Java Code, ... and I also seem to remember *some* discussions of them: What MIKE is, obviously, doing, is putting *all String* Literals at the top. Named $1,$2, etc He put's those String literals all in a VERY BIG Line (hence you will see them NOT with an Editor) I think, he made this decision, to keeep the string's (or Rexx Strings) *initialized* once forwever. As far as I can re-call my tests (years ago, sorry) I think I cann recall he does have the same strategy for *the source Code*. I'm having another one, but that should no be discussion point yet ... When I might help you, simply give me a mail... Thomas. ======================================================================= David Requena schrieb: > Kermit, > > Yes, I see. It is in fact a very similar pattern to what I've used > often when working with big Lostusscript programs in products like > Lotus Workfow, where you could attach the debugger. > > I guess I jumped too fast on that one without really thinking much > about what I was actually going to ask.Or in other words: yes, I was > being dumb :-) > > According to the language definition 1.00: > "In some implementations, the use of trace instructions may > substantially increase the size of classes and the execution time of > methods affected by tracing." > > I wonder how much that increase might be. To be honest I always > assumed that if it was big enough to be mentioned in the docs, it must > be quite significant. > --- > Saludos / Kind regards. > David Requena > > El 15/02/2010 17:18, Kermit Kiser escribi?: >> You are close to my idea. There is an undocumented option in >> NetRexxScript to turn on "df" (the debug flag) - the option is only >> visible on the plugin options screen if you are running as account >> "dad". ;-) If not under that account, the option can be turned >> on/off via a script. Here is the debug.nrx script from the >> //useracct//.jedit/NetRexx directory: >> >> --------------------------------------------------------------------------------------------------------------------- >> >> -- This script turns the plugin debug flag on or off >> -- ***** warning - setting flag on can produce lots of log and other >> output >> >> trace results >> >> OPTION_PREFIX = String "options.netrexxscript." >> t=boolean 1 -- "true" >> f=boolean 0 -- "false" >> >> >> jEdit.setBooleanProperty(OPTION_PREFIX"debug",\jEdit.getBooleanProperty(OPTION_PREFIX"debug",f)) >> >> ---------------------------------------------------------------------------------------------------------------------- >> >> I guess that I was not confident the code was bulletproof yet, so I >> left in the option to trace most of the code in case unexpected >> problems might show up. It came in very handy in the development >> phases to limit the large volume of debug output to periods of >> looking at a specific bug! >> >> -- Kermit >> >> >> David Requena wrote: >>> Thomas, >>> >>> That is indeed a very valid point. >>> Thought of the possibility of activating debug mode on production >>> code by using some command line switch just after sending my >>> previous email. >>> >>> Thanks, >>> David >>> >>> --- >>> Saludos / Kind regards. >>> David Requena >>> >>> >>> El 15/02/2010 13:44, Thomas Schneider escribi?: >>>> Hi David, >>>> I'm using a similar approach than Kermit, to have an OPTION to >>>> *Dynamically* force DEBUG. >>>> I'm rarely using TRACE, but I do have a lot of conditional debugs >>>> in my program, which I can even >>>> use in the PRODUCTION version just in case a not anticipated >>>> situation occurs in the program >>>> of a client. >>>> >>>> This is just for your info. >>>> >>>> Similarly, I do use a lot of assertions in my code, and did invent >>>> some special notation >>>> for those in my newer programs, e.g.: >>>> >>>> x=3 >>>> y=x ::= 3 >>>> >>>> where :: introduces an assertion, which is checked at run tyme (in >>>> this case, y MUST be 3) >>>> >>>> when it is NOT 3, an ASSERTION error message is given (and when >>>> not otherwise wanted, >>>> the program aborts immediately. >>>> >>>> Tom. >>>> ======================================================== >>>> Kermit, please give us the reson of cyour decision as well. >>>> >>>> David Requena schrieb: >>>>> Kermit, >>>>> >>>>> hmm.. got curious. I noticed the following on your supplied code >>>>> snipped: >>>>> >>>>> if df then trace results >>>>> >>>>> Here I'm supposing df is a property appropriately set up upstream >>>>> as needed. >>>>> >>>>> This is a construct I've used often in other languages but in >>>>> NetRexx I tend to use trace statements liberally as needed. Then >>>>> for production build I use 'options notrace' so no overhead is >>>>> incurred. >>>>> >>>>> Any reason why would you prefer the conditional check over >>>>> NetRexx' options nobinary idiom? >>>>> >>>>> Maybe I'm being dumb but seems to me the conditional would be >>>>> carried to production code whereas options nobinary would >>>>> eliminate any trace (yeah, redundant) of trace code. >>>>> >>>>> --- >>>>> Saludos / Kind regards. >>>>> David Requena >>>>> >>>>> El 13/02/2010 8:16, Kermit Kiser escribi?: >>>>>> Thomas ; >>>>>> >>>>>> There was an exchange about reading Zip/Jar files on the list >>>>>> last month. I don't know if you were on the list then, so I am >>>>>> attaching it here. >>>>>> >>>>>> It sounds like you might be interested in the actual code to read >>>>>> the data also, so here it is: >>>>>> >>>>>> ------------------------------------------------------ general >>>>>> purpose routines >>>>>> ------------------------------------------------------- >>>>>> >>>>>> method copyjarentry(jf=JarFile,je=JarEntry,scriptdir=String) >>>>>> -- method to copy a jarfile entry to a directory >>>>>> >>>>>> if df then trace results nrscript=scriptdir||fs||je.getName >>>>>> >>>>>> nrs=File(nrscript) >>>>>> >>>>>> if \nrs.exists then do >>>>>> >>>>>> rc=copyjarentrytofile(jf,je,nrs) >>>>>> >>>>>> if rc=1 then say je.getName "copied to:" scriptdir >>>>>> >>>>>> end >>>>>> >>>>>> method copyjarentrytofile(jf=JarFile,je=JarEntry,nrs=File) >>>>>> >>>>>> if df then trace results >>>>>> >>>>>> do >>>>>> >>>>>> scriptstream=jf.getInputStream(je) >>>>>> >>>>>> if Rexx(je.getName).pos(".class")=0 then do >>>>>> >>>>>> >>>>>> scriptreader=BufferedReader(InputStreamReader(scriptstream)) >>>>>> >>>>>> -- >>>>>> scriptwriter=BufferedWriter(OutputStreamWriter(outstream)) >>>>>> >>>>>> scriptwriter=BufferedWriter(FileWriter(nrs)) >>>>>> >>>>>> copyfile(scriptreader,scriptwriter) >>>>>> >>>>>> scriptwriter.close >>>>>> >>>>>> end >>>>>> >>>>>> else do >>>>>> >>>>>> outstream=FileOutputStream(nrs) >>>>>> >>>>>> copybin(scriptstream,outstream) >>>>>> >>>>>> outstream.close >>>>>> >>>>>> end >>>>>> >>>>>> catch badguy=Exception >>>>>> >>>>>> say je.getName "copy error =" badguy >>>>>> >>>>>> return 0 >>>>>> >>>>>> end >>>>>> >>>>>> return 1 >>>>>> >>>>>> /* methods to copy a file: */ >>>>>> >>>>>> method >>>>>> copyfile(ifq=java.io.BufferedReader,ofq=java.io.BufferedWriter) >>>>>> signals IOException >>>>>> >>>>>> if df then trace results >>>>>> >>>>>> line=ifq.readline >>>>>> >>>>>> if line = null then return >>>>>> >>>>>> ofq.write(string line,0,line.length) >>>>>> >>>>>> trace off >>>>>> >>>>>> loop forever >>>>>> >>>>>> line=ifq.readline >>>>>> >>>>>> if line = null then leave >>>>>> >>>>>> ofq.newline() >>>>>> >>>>>> ofq.write(string line,0,line.length) >>>>>> >>>>>> end method copybin(ifq=InputStream,ofq=OutputStream) >>>>>> binary signals IOException >>>>>> >>>>>> bite=ifq.read >>>>>> >>>>>> loop while bite \= -1 >>>>>> >>>>>> ofq.write(bite) >>>>>> >>>>>> bite=ifq.read >>>>>> >>>>>> end >>>>>> --------------------------------------------------------------------------------------------------------------------------------------------------- >>>>>> >>>>>> >>>>>> >>>>>> Kinda crude, but maybe it helps. >>>>>> >>>>>> note: fs=File.separator >>>>>> >>>>>> -- Kermit >>>>>> >>>>>> >>>>>> Thomas Schneider wrote: >>>>>>> Hi Divid, >>>>>>> .. many thanks for the Details. >>>>>>> ... MFC already said me the same thins! >>>>>>> >>>>>>> Isn't that (OUR) Universe ... >>>>>>> >>>>>>> ..... a UNIQUE thing ?? >>>>>>> Thomas. >>>>>>> ... will read your message (below) tomorrow in more detail. >>>>>>> = Did archive it now, I'm gooing a'sleeeeep ... >>>>>>> ================================================================= >>>>>>> David Requena schrieb: >>>>>>>> Thomas, >>>>>>>> >>>>>>>> ZIP and JAR are the same thing. >>>>>>>> >>>>>>>> There is standard stuff in the java library for manipulating >>>>>>>> this format. >>>>>>>> Look at the package java.util.zip classes. >>>>>>>> >>>>>>>> David >>>>>>>> >>>>>>>> 2010/2/12 Thomas Schneider <[hidden email] >>>>>>>> <mailto:[hidden email]>> >>>>>>>> >>>>>>>> Hi there again, >>>>>>>> first, I must admit that I am *NO* Java *NOR* NetRexx Expert. >>>>>>>> second, I would like to enhance my FILE-Access routines >>>>>>>> (current >>>>>>>> doc in \Rexx2RT\RexxFile >>>>>>>> (in the Run-Time package of www.Rexx2Nrx.com >>>>>>>> <http://www.Rexx2Nrx.com> since years) to do the following: >>>>>>>> >>>>>>>> -- using a special (computer independent) Syntax to read 'the >>>>>>>> members of: >>>>>>>> >>>>>>>> -- a JAR File >>>>>>>> -- a ZIP File >>>>>>>> -- an IBM zOS PDS file >>>>>>>> >>>>>>>> ON demand (e.g. to use linein, lineout, and all the other >>>>>>>> things >>>>>>>> already implemented >>>>>>>> in RexxFile (without the need to CHANGE the 'calling program') >>>>>>>> >>>>>>>> Also, the '/' may now be used as a GENRIC File-separator >>>>>>>> (translated to '\' in the >>>>>>>> Windows case...) >>>>>>>> >>>>>>>> Questions: >>>>>>>> >>>>>>>> 1.) What do you suggest as the proper syntax for the >>>>>>>> LIBRARY Name >>>>>>>> preceeding >>>>>>>> the filename (may it be a JAR, a ZIP, or an IBM z-OS PDS) >>>>>>>> >>>>>>>> 2.) Does anyone of you have a (small) example how I can >>>>>>>> read/write >>>>>>>> the LINES >>>>>>>> of a specified MEMBER of a JAR/ZIP file in Java/NetRexx.. >>>>>>>> >>>>>>>> Tom. >>>>>>>> >>>>>>>> PS: I already got from Walter Pachl some (very old & very >>>>>>>> good) >>>>>>>> examples >>>>>>>> how to read an IBM PDS File thru EXECIO. >>>>>>>> >>>>>>>> I am currently testing my own implementation of EXECIO for >>>>>>>> Rexx2Nrx. >>>>>>>> Thomas Schneider. >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Ibm-netrexx mailing list >>>>>>>> [hidden email] >>>>>>>> <mailto:[hidden email]> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Saludos / Regards, >>>>>>>> David Requena >>>>>>>> >>>>>>>> ------------------------------------------------------------------------ >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Ibm-netrexx mailing list >>>>>>>> [hidden email] >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Ibm-netrexx mailing list >>>>>>> [hidden email] >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Ibm-netrexx mailing list >>>>>> [hidden email] >>>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> >>>>> _______________________________________________ >>>>> Ibm-netrexx mailing list >>>>> [hidden email] >>>>> >>>> >>>> _______________________________________________ >>>> Ibm-netrexx mailing list >>>> [hidden email] >>>> >>> _______________________________________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> >>> >>> >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> >> > ------------------------------------------------------------------------ > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > >
Tom. (ths@db-123.com)
|
In reply to this post by Mike Cowlishaw
Hello there,
just my 2 % : The current implementation of NetRexx does copy all SOURCE-Lines of the source in question into the TARGET (Java) Program .... ... At least when I did read the generated Java Code right (with the past releases). I am (personally) following another PHILOSOPHY: But I do NOT like to discuss this, unless other members of this list are interested.... Thomas. ================================================================ Mike Cowlishaw schrieb: > According to the language definition 1.00: > "In some implementations, the use of trace instructions may > substantially increase the size of classes and the execution time of > methods affected by tracing." > > I wonder how much that increase might be. To be honest I always > assumed that if it was big enough to be mentioned in the docs, it must > be quite significant. > > Yes .. the code to generate the traces has to be in place (unless > turned off by the options/compile-time flag). To decide whether > that's significant or not, in your context, choose a reasonably large > class, and compile it. Observe the size of the class file. > > Next, add a trace statement at the top of the class -- again compile > and observe the resulting size. This will vary depening on the trace > option, of course, so several variations would be interesting. > (Report back here?) > > Size of class might not matter too much nowadays, although it will > slow down loading. But worth being aware of it. > > Mike > > > ------------------------------------------------------------------------ > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > >
Tom. (ths@db-123.com)
|
> The current implementation of NetRexx does copy all
> SOURCE-Lines of the source in question into the TARGET (Java) > Program .... That's nonsense Tom. The source is only there if the programmer requires it (for tracing, for example). A NetRexx class is [almost] identical to a Java class for the same program if one wants it to be (the binary applet examples, for example). I seem to recall that the NetRexx version is one byte shorter, in fact, because the name of the source file is .nrx instead of .java ... Mike |
NO, Mike, *it's* ***NO *** NON-Sense*** what you are actually doing, If I am reading your Generated Java Code, (unless somebody did change it recently): When TRACE is used, you are putting the WHOLE source into the COMPILED program(as a COPY...) I am currently NOT sure, if you do this with all OPETIONS of TRACE (like TRACE VAR ::) But I would have means on my fingers that I sould intantly RE-TRY this again, as I did some 7 years ago ...) Kind regards, Tom. PS: See you at SpeleoTrove PPS: And thank you so much for the (personal) explanation what SpeleoTrove stands for. Wouldn't it be the right time to explain it to this list, Mike ??? ==================================================================== Mike Cowlishaw schrieb: >> The current implementation of NetRexx does copy all >> SOURCE-Lines of the source in question into the TARGET (Java) >> Program .... >> > > That's nonsense Tom. The source is only there if the programmer requires it > (for tracing, for example). A NetRexx class is [almost] identical to a Java > class for the same program if one wants it to be (the binary applet > examples, for example). I seem to recall that the NetRexx version is one > byte shorter, in fact, because the name of the source file is .nrx instead > of .java ... > > Mike > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > >
Tom. (ths@db-123.com)
|
In reply to this post by Mike Cowlishaw
Mike,
I'll be checking out of curiosity. Should have been done this in the first place. I agree class size is not that much of a concern nowadays. OTH execution time could definitely be. I've a class which, if so configured, will apply a complex regex to a whole nrx buffer*on every user key press*. Of course it's doing a lot of other things. I wonder if it will be noticeable. Unfortunately my timings are bound to be inexact but surely a trend could be seen. I this was running standalone I would keep generated java files and instrument them in NetBeans for some proper profiling but, being run inside jEdit, I'm not sure at all this can be done. Be back to the list the having some numbers. --- Saludos / Kind regards. David Requena El 15/02/2010 21:41, Mike Cowlishaw escribi?: > According to the language definition 1.00: > "In some implementations, the use of trace instructions may > substantially increase the size of classes and the execution time of > methods affected by tracing." > > I wonder how much that increase might be. To be honest I always > assumed that if it was big enough to be mentioned in the docs, it must > be quite significant. > Yes .. the code to generate the traces has to be in place (unless > turned off by the options/compile-time flag). To decide whether > that's significant or not, in your context, choose a reasonably large > class, and compile it. Observe the size of the class file. > Next, add a trace statement at the top of the class -- again compile > and observe the resulting size. This will vary depening on the trace > option, of course, so several variations would be interesting. > (Report back here?) > Size of class might not matter too much nowadays, although it will > slow down loading. But worth being aware of it. > Mike > > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > An HTML attachment was scrubbed... URL: http://ns.hursley.ibm.com/pipermail/ibm-netrexx/attachments/20100216/d253b1ea/attachment.html |
Free forum by Nabble | Edit this page |