/* NetRexx | | Name: RexxVerN | | Author: David Alcock | | Purpose: Show the Rexx version and environment information | | Written: 26 January 1998 | | Change History: | - 09-FEB-1998 David Alcock | - Removed special code for TSO formatting of PARSE SOURCE | - Print execution date | - 28-FEB-1998 David Alcock | - New variant of REXXVER rexx exec created as name REXXVERN | as NetRexx version so it can be used on as a JAVA applet | - ADDRESS() not implemented in NetRexx | - TRANSLATE(Date(... eliminated because of Java Date format | - Added Java environment display */ class rexxvern extends Applet offsetx; offsety -- Text position of output charh; charw -- Character height and width /* +------------------------------------------------------------ | Paint method | | Here's where we do the dirty work +------------------------------------------------------------ */ method paint(g=Graphics) setFont(Font("Courier",Font.PLAIN,12)) f = Font("Courier", Font.PLAIN, 12) fm = getFontMetrics(f) charw = fm.stringWidth("W") charh = fm.getHeight() g.setFont(f) g.setColor(Color.red) offsetx = 10 offsety = 0 /* sayit("ADDRESS() returns '"address()"'") */ sayit(g,"ADDRESS() not available in NetRexx") sayit(g," ") PARSE VERSION lang ver dated datem datey sayit(g,"VERSION: Lang("lang") Version("ver") Date("dated datem datey")") sayit(g," ") PARSE SOURCE s1 s2 s3 s4 s5 s6 s7 s8 s9 sayit(g,"SOURCE: Env("s1")") sayit(g," source2("s2") source3("s3") source4("s4")") sayit(g," source5("s5") source6("s6") source7("s7")") sayit(g," source8("s8") source9("s9")") sayit(g," ") sayit(g,"RexxVerN executed on "date()" ") /* Non-Netrexx (JAVA) environment information from executing system */ sayit(g," ") sayit(g,"Java System properties for executing system:") sayit(g,"java.version....."System.getProperty("java.version")) sayit(g,"java.vendor......"System.getProperty("java.vendor")) sayit(g,"os.name.........."System.getProperty("os.name")) sayit(g,"os.version......."System.getProperty("os.version")) /* +------------------------------------------------------------ | Sayit method | | Simulate SAY rexx function to write to applet window +------------------------------------------------------------ */ method sayit(g=Graphics, arg) parse arg msg /* ====> say msg \* echo to Java console *\ <==== */ offsety = offsety + charh g.drawString(msg, offsetx, offsety) /* show it in applet area */ /* +------------------------------------------------------------ | The End - of rexxvern.nrx +------------------------------------------------------------ */