Alan,
On 17.10.2011 19:06, Alan Sampson wrote:
from your initial e-mail, entitled "java.lang.NumberFormatException from java.io.Writer.write()", from 2011-10-01: You created a String from the players[r_] entry and assigned it to a Rexx variable. So that's the version I had memorized. (Sorry, if I overlooked a clarification w.r.t. casting the method's argument explicitly to String in the discussion!) Trying to cast the method invocation ["filebuff.write(String rec)"] or making sure that "rec" is of type String ["rec=String" before the loop] does treat the String like a Rexx value and therefore is not able to resolve the write(String) method in the superclass. A Rexx and a String value in this case are treated interchangeably/identically. This behaviour is surely questionable. Especially, if one explicitly casts an argument, clearly indicating the desire to use a method that possesses that strict type (eventually forcing method resolution in the superclass). Also, if one strictly types a value, then while carrying out the method resolution the strict types (clear information given by the NetRexx programmer) should prevail the cost-based picking of a method for that particular argument. --- The following variation using also the stractassign option works (but note the cast needed for creating the filebuff value); changes bolded: /* NetRexx */---rony _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Rony G. Flatscher (wu-wien)
Rony -
Thanks again for bringing to the surface any assumptions or speculations that need to be discussed openly. I admit that I am a little puzzled about why you keep insisting that the costing algorithms NetRexx uses are somehow secret or hidden. NetRexx has been open source for several months now so anyone can read the code. But Thomas has asked for a zip version of the latest "after3.01" source, so I am going to assume that some people might not be able to access the SVN repository. I have just posted a zip file with the latest version of the after3.01 branch (revision 159), including source, in the NetRexx Plus download area for anyone who wants to download it: http://kenai.com/projects/netrexx-plus/downloads/download/Experimental%20NetRexx%20Build/after3.01.zip Mike did a great job of isolating all of the tables and logic for cost calculations and conversion in one module: RxConverter Here are his comments from the costing method in that module: /** -------------------------------------------------------------------- ASSIGNCOST -- return cost of assigning one type to another Arg1 is context cursor [only needed for subclass resolution] Arg2 is LHS type (LHS <= RHS) Arg3 is RHS type Costs are as follows [range 0-100]: 0 -- exact match, or null assigned to reference 1-5 -- free conversion (widening primitive) 10 -- safe conversion or superclass cast These conversions can only fail if out of space 11-12: boolean -> primitive, etc. 14: String/Rexx -> char[] 15: char and char[]->String/Rexx/char[] widening conversions with cost (except char->char[]) 17: Other Rexx/String/char[] conversions 20 -- safe conversion (new object) required, risk of space error, or string out of bounds (iff String -> char) (A safe conversion will raise runtime exception if loss of information) This includes primitive -> boolean 25 <= boundary for automatic conversions 30 -- primitive cast required 40 -- class cast required (e.g., to subclass), risk involved -- conversion (new object) required, risk of space or conversion error, or potential loss of information, i.e., toString 50 <= boundary for explicit conversions 100 -- conversion impossible (e.g., dissimilar types, or dimensions mismatch) If returns <100 then ASSIGNPROC is set to indicate the procedure (algorithm) to be used for effecting the conversion (defined and for use by CONVERTCODE). If returns 100 then ASSIGNPROC is undefined. Note that method assign and true assign are treated the same at the moment, but in fact they may differ slightly (e.g., byte<->int); we may want to expose or hide this later. -------------------------------------------------------------------- */ Perhaps that will help explain why I selected cost 17 for the String<=>CharSequence<=>Rexx conversions in 3.01. But that decision can be revised if needed, as I mentioned before. I have added a few comments to your note using underscore italic this time. -- Kermit On 10/17/2011 9:23 AM, Rony G. Flatscher wrote: Hi Kermit,See Mike's comments from the costing algorithm in RxConverter that I pasted above. There is another interesting point here IMHO: in Alan's example, everyone who reads the code is inclined to conclude, that indeed the method in the superclass (expecting a String) is better than the one in the class the object got created from (expecting an int). The reason probably being that the program's Rexx variable, which serves as an argument, does not contain a number. So the conclusion is even stronger: it is only the String-version of the method that in this very particular case is the right method to pick!As Alan has pointed out, when trying to fix the error, he did indeed try an exact match call to write(String) just as a Java programmer would use and NetRexx still did not allow it! But even when he used the signature write(Rexx), Mike's costing algorithm returned cost 20 to convert Rexx to int and only cost 17 to convert Rexx to String. Oops! The costing algorithm had no effect in this case! If both methods were in the same class, the NetRexx costing algorithm would have picked the desired write(String) method, but the current NetRexx does not allow that method to even be seen! There is no problem with Mike's costing algorithm - it is definitely safer to convert Rexx to String than to int. The problem is simply caused by not allowing NetRexx to "see" the methods available so it can make a better choice. I simply meant to point out that if a superclass adds or deletes a method which has been picked by NetRexx (or Java) at compile time, it can change the method being used at runtime.The above summary shows that the proposed method selection behavior is much closer to the way that Java behavesThe warning here: this is purely by co-incidence and can be even wrong (like in the case, where "17" was indeed meant to be an integer number by the programmer in Alan's example). See my comment above.... cut ... Odd. It works perfectly in my proposed "after3.01" translator version. The first constructor is present in 3.01. I am not sure the second would be useful, but it could be added if needed. As for the cost item, see my comments above.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by alansam
Hello all,
from my point of view, it's simply WRONG that any Rexx string *can be converted* to an INTEGER, at all. Thus, it's now a matter of COST! It is simply an ERROR that any Rexx String can be converted to an INTEGER. Thus, Alan's example of the usage of WRITE should produce an ERROR message (Cannon convert given method 'write(Rexx)' to any available method' and NOT implicietyl TRY to convert a Rexx String to an INT! Full Stop. Thomas Schneider. ========================================================= Am 17.10.2011 19:06, schrieb Alan Sampson:
--
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
Misspelled in typing, ahain, I'm sorry...
it's now a matter of COST should read: it's *not* a matter of COST! I will try to type slower and make less errors (or re-read my messages before I press the send button) ... Promised, and I do apologize, but a Rexx STRING cannot be COERCED to an INTEGER in all cases, and thus the obviously WRONG method is selected bvy the current costing algorithm! Thomas. ======================================================== Am 18.10.2011 15:56, schrieb Thomas Schneider: Hello all, --
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
'Every thing' in a computer is coded in binary integers!
Bob Hamilton, Engineer On Tue, Oct 18, 2011 at 9:00 AM, Thomas Schneider <[hidden email]> wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Hello Robert,
*BUT NOT* everything coded in binary integers IS a NUMBER! Sorry! And a STRING might REPRESENT a NUMBER, *or* a TEXT! Thus, my feeling is: 1.2 *is NOT* equal to '1.2' (semantically) (as '...' might also contain: 'Robert Hamilton'), thus: rec='Robert Hamilton' rec.wite *might NOT be automatically coerced to:* rec.write.toInt() Thomas. ================================================== Am 18.10.2011 16:39, schrieb Robert Hamilton: 'Every thing' in a computer is coded in binary integers! --
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
Thomas,
Consider this Rexx program: say "enter a number"Then run the above program and enter "1" on the first run and look at the output. Then re-run it entering something like "abc". How would you (or your package) translate that Rexx program to NetRexx? What results does the NetRexx version give, if you feed it the above two values? (And what is the meaning of "options binary", according to the NetRexx language specification, in this context, what would it do?) ---rony _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Robert L Hamilton
I have been teaching myself netrexx and OO coding for over a year now with the help of this list and the resources it points me to. My progress has been quite good, building on the examples I gleened from the net. Thanks to all of you who have prepared the tutorials and documentation. Now I wonder if anyone would have the time and inclination to look at some of my code and tell me if I am on the right track. My biggest confusion is with encapsulation. I _want_ to pass some values around and have them computed and displayed in different frames. /*NetRexx */ options replace comments java crossref savelog symbols verbose4 trace1 logo --import java.awt.List import java.io.Reader import java.text. -- Needed for the SimpleDateFormat class import java.util. -- Needed for integer math import netrexx.lang.Rexx -- this is our main class class qandagui Properties inheritable static -- some vars for the whole class question1 = Rexx[99] answerX = Rexx[99,5] RorW = Rexx[99,5] ans_done = int[99] rightones = int 0 try_cnt = 0 sub_k = int Random_Int = int My_Int = rexx response1 = Rexx method main(s=String[]) static say 'Executing the latest code on' date() source /* t1=time('R') */ /* Open and check the files */ do inhandle=BufferedReader(InputStreamReader(FileInputStream('C:\\Documents and Settings\\keklein\\My Documents\\REXX\\NetRexx\\bin\\QandA.txt'))) say 'Processing infile' catch Z=IOException say '# error opening file' Z.getMessage end /* The processing loop to load our table from the txt file. ***/ loop sub_k = 0 by 1 line = inhandle.readLine -- get next line as Rexx string if line=null then leave sub_k -- normal end of file parse line 'Q1 ' question_in question1[sub_k] = question_in line = inhandle.readLine -- get next line as Rexx string if line=null then leave sub_k -- normal end of file parse line - A1 answer_in1 ',' - A2 answer_in2 ',' - A3 answer_in3 ',' - A4 answer_in4 ',' - A5 answer_in5 ',' . ; answerX[sub_k,0] = answer_in1 answerX[sub_k,1] = answer_in2 answerX[sub_k,2] = answer_in3 answerX[sub_k,3] = answer_in4 answerX[sub_k,4] = answer_in5 RorW[sub_k,0] = A1 RorW[sub_k,1] = A2 RorW[sub_k,2] = A3 RorW[sub_k,3] = A4 RorW[sub_k,4] = A5 end sub_k loop label checkarray sub_i = 0 to (sub_k - 1) say say sub_i question1[sub_i] loop label innerloop sub_j = 0 to 4 say sub_i sub_j "-->" answerX[sub_i,sub_j] RorW[sub_i,sub_j] end innerloop say end checkarray say 'Total questions to be asked =' sub_k "Press enter to continue..." response1=ask if response1.upper == "Q" | response1 == "X" then exit loop label clrscn for 99; say; end clrscn; -- loop label Rep_Screen_thru_table until frm.Possible_Answer[ix] = 'Right.' trace results RepeatScreen(sub_k) -- end Rep_Screen_thru_table ; method RepeatScreen(total_lines = int) static try_cnt = try_cnt + 1 rightones = rightones + 1 Random_Int = GetRand(sub_k) loop label findundone while ans_done[Random_Int] == 1 if Random_Int < sub_k then Random_Int = Random_Int + 1 if Random_Int >= sub_k then Random_Int = 0 end findundone ans_done[Random_Int] = 1 this_question='Question' Random_Int || ')' question1[Random_Int] abf=AboutFrame(this_question,answerX[Random_Int,0],RorW[Random_Int,0],answerX[Random_Int,1],RorW[Random_Int,1],answerX[Random_Int,2],RorW[Random_Int,2],answerX[Random_Int,3],RorW[Random_Int,3],answerX[Random_Int,4],RorW[Random_Int,4],try_cnt) abf.SetTitle('BJCP Training') /* Set a title */ abf.Set_Question(this_question) abf.Set_Pos_Answer(answerX[Random_Int,0],RorW[Random_Int,0]) abf.Set_Pos_Answer(answerX[Random_Int,1],RorW[Random_Int,1]) abf.Set_Pos_Answer(answerX[Random_Int,2],RorW[Random_Int,2]) abf.Set_Pos_Answer(answerX[Random_Int,3],RorW[Random_Int,3]) abf.Set_Pos_Answer(answerX[Random_Int,4],RorW[Random_Int,4]) abf.SelectQuestion(0) /* Select first Question */ abf.ShowAbout() /* Show it */ say try_cnt "attempts. " rightones "correct. " try_cnt - rightones "wrong." try_cnt / rightones || "%" /* t2=time('E') */ /* t=rexx(t2-t1).format(7,5).strip('L').strip('T','O') */ /* say "Percent:" rightones/(rightones)*100"% Elapsed time in seconds:" t */ method GetRand(total_lines = int) returns rexx static My_int = (total_lines*Math.random()) % 1 -- %1 make result to integer RETURN My_Int class AboutFrame extends Frame Properties inheritable NbrFrames = 0 TxtWho = TextArea(' ',400,999,TextArea.SCROLLBARS_NONE) List_Question = java.awt.List(5) -- define a List Box TxtAppl = Label -- declare read-only text PbtCncl = Button('Exit the quiz') -- define a push button dispScore = TextField(12) -- define a push button myint = int 1 -- declare number of questions questions = int -- declare number of questions Possible_Answer = String[] -- declare this array Possible_AnswerL = String[] Method AboutFrame(Here_Question = String, - Here_answer1 = String, - Here_RW1 = String, - Here_answer2 = String, - Here_RW2 = String, - Here_answer3 = String, - Here_RW3 = String, - Here_answer4 = String, - Here_RW4 = String, - Here_answer5 = String, - Here_RW5 = String, - Total_trys = int) - public myint = Total_trys say myint "=" Total_trys dispScore = TextField(myint) -- define a place to put the score nbrFrames = nbrFrames+1 if nbrFrames > 10 then exit -- As our class is a frame extension, we should not call Frame() -- else we'd create yet another frame win = Frame("About") -- should not be coded win = this -- "win" is nicer than "this" -- We can call the parent class to set a frame title. super.SetTitle(Here_Question) -- define default frame title Possible_Answer = String[5] -- create this array Possible_AnswerL = String[5] -- create this array questions = -1 -- no questions defined yet -- To close the window from the system menu work with WindowListener anObject = AboutFrameController() -- Create this object -- Because "we" are a frame, no need to write "win.add" -- but it may be clearer for some readers. win.addWindowListener(anObject) -- To be able to react to end-user frame events pbtCncl.addActionListener(AboutActionClass(this,'pbtCncl') ) List_Question.addActionListener(AboutActionClass(this,'List_Question') ) List_Question.addItemListener(AboutActionClass(this,'List_Question') ) -- add the visible objects to the frame TxtAppl = Label('The application has been written by') TxtWho.setEditable(0) -- make this area read only win.add("North" , TxtAppl) -- add these objects to the frame win.add("West" , List_Question) win.add("Center" , TxtWho) p = Panel() -- Host the button in a "panel" to keep it small win.add("South" , p) -- add the "panel" to the frame p.add(PbtCncl) -- place the button in the "panel" q = Panel() -- Host the button in a "panel" to keep it small win.add("East" , q) -- add the "panel" to the frame q.add(dispScore) -- place the button in the "panel" -- use some colors hYell = color(255,255,128) -- define a color object TxtAppl.setBackground(color.white) -- color of application text setBackground(color.white) -- color of our frame pbtCncl.setBackground(color.lightGray) -- color of our button List_Question.setBackground(hYell) -- color of our LISTBOX TxtWho.setBackground(hYell) -- color of our text area ----- calculate a good place for our frame --------------- setSize(1100,200) -- define size of window. offset = (NbrFrames-1) *10 -- don't place all at same place d = getToolkit().getScreenSize() -- get size of the screen s = getSize() -- get size of our frame SetLocation( (d.width - s.width) %6 + offset, - (d.height - s.height)%6 + offset ) Method SetTitle(t = String) -- Define title of the window super.setTitle(t) -- Must be preceeded by "super" else we -- call ourselves Method Set_Question(t = String) -- Define the title of the window TxtAppl.setText(t) Method Set_Pos_Answer(My_Answer = String,Descript = String) questions = questions+1 -- add an element to the questions list box List_Question.add(My_Answer) Possible_Answer[questions] = Descript -- add his description to array -- say questions My_Answer Descript Method Set_Pos_Answer(My_Answer = String,Descript = String,DescLong = String) questions = questions+1 List_Question.add(My_Answer) Possible_Answer[questions] = Descript Possible_AnswerL[questions] = DescLong Method SelectQuestion(ix = int) if ix<= questions then List_Question.select(ix) Method ShowAbout() -- As "we" the object are in fact a frame, no need to code this.setVisible(1) -- setVisible(1) --------- This class handles events on the frame itself ---------- class AboutFrameController extends WindowAdapter method windowClosing(e = WindowEvent) Say 'Closed by system menu' exit --------- This class handles Action Events with objects in the frame class AboutActionClass implements ActionListener,ItemListener Properties inheritable frm = AboutFrame -- frm is an object of class AboutFrame myEventName = String -- a string is passed and available in the class int_I = int 0 rightones = 0 -- Constructor method AboutActionClass(x = AboutFrame, anEvent = String) frm = x myEventName = String anEvent method actionPerformed(e = ActionEvent) Say 'Event happened for:' myEventName Select when myEventName = 'pbtCncl' then do Say 'Closed by Cancel button' frm.dispose() return end when myEventName = 'List_Question' then do -- double click in List Box -- Beware: testing if ..[] = '' is dangerous, it may yield a -- null pointer exception. So test for "null" ix = frm.List_Question.getSelectedIndex() -- Get the selected line t = '' if frm.Possible_AnswerL[ix] <> null then if frm.Possible_AnswerL[ix] <> '' then t = frm.Possible_AnswerL[ix] if t<>'' then do frm.TxtWho.setForeground(color.black) frm.TxtWho.setText(t) end else do frm.TxtWho.setForeground(color.red) frm.TxtWho.setText('More information about' - frm.List_Question.getSelectedItem()- 'is not available') end end Otherwise Say 'Problem:' myEventName 'is unknown' end method itemStateChanged(e = ItemEvent) -- Apparently we warp to this point when the answer item is clicked. Select when myEventName = 'List_Question' then do ix = frm.List_Question.getSelectedIndex() -- Get the selected line -if any -- Say 'Select event in Listbox, item:' ix if frm.Possible_Answer[ix] = 'Right.' then do rightones = rightones + 1 say "Great! you found the right answer." rightones frm.dispose() qandagui.RepeatScreen(75) end if frm.Possible_Answer[ix] = 'Wrong.' then do -- increment the counter up in the qandagui class say frm.dispScore.getText() if frm.dispScore.getText() > 0 then do int_I = frm.dispScore.getText() int_I = int_I + 1 say int_I " <-- gettext #" end else do -- if the field is null grab the try_cnt int_I = qandagui.try_cnt + 1 say int_I " <-- gettext #" end end frm.TxtWho.setForeground(color.black) if ix >= 0 then frm.TxtWho.setText(frm.Possible_Answer[ix]) else frm.TxtWho.setText(' ') end Otherwise Say 'Problem:' myEventName 'is unknown' end Say 'This is the Possible_answer:' frm.Possible_Answer[ix] GuiApp(int_I) frm.dispScore.setText(int_I) -- display the number of correctly answered questions -- display the number of incorrect answers -- display the percent of correct answers class GuiApp Properties inheritable window = Frame method GuiApp(The_Score) -- Create a frame window window = Frame('Multiple choice quiz score.') -- Set the size of the window window.setSize(210,100) -- Set the window position to the middle of the screen d = window.getToolkit().getScreenSize() s = window.getSize() window.setLocation((d.width - s.width) % 2,(d.height - s.height)%2) -- Add a label to the window. The label text is centered f = SimpleDateFormat("H:mm:ss" ) -- Formats hours:minutes:seconds text1 = Label("Started at:" f.format(Date()) ,Label.CENTER) text2 = Label("Total running score of attempts." The_Score,Label.CENTER) window.add("North" , text1) -- Add the label to the window window.add("Center" , text2) -- Add the label to the window -- add the window event listener to the window for close window events window.addWindowListener( CloseWindowAdapter() ) -- show the window window.setVisible(1) /*------------------------------------------------------------------------------- The CloseWindowAdapter exits the application when the window is closed. WindowAdapter is an abstract class which implements a WindowListener interface. The windowClosing() method is called when the window is closed. -----------------------------------------------------------------------------*/ class CloseWindowAdapter extends WindowAdapter method windowClosing( e=WindowEvent ) exit 0 The above program uses the following input file: Q1 Name a commercial example of a brown porter. Right. Sam Smith Taddy Porter, Wrong. Sleeman Cream Ale, Wrong. Anchor Porter, Wrong. Baltika porter, Wrong. Leffe Blonde, Q1 Name a commercial example of a robust porter. Wrong. Samual Smith Taddy Porter, Wrong. Brooklyn Brown Ale, Wrong. Lost Coast Downtown Brown, Wrong. Baltika porter, Right. Great Lakes Edmund Fitgerald, Q1 Name a commercial example of a (5B) traditional Bock. Right. Einbecker Ur-bock, Wrong. Sleeman Cream Ale, Wrong. Zum Uerige, Wrong. Avery Salvation, Wrong. Rochefort 8, Q1 Name a commercial example of a (11C) Northern English Brown Ale. Right. Newcastle, Wrong. Sleeman Cream Ale, Wrong. Brooklyn Brown Ale, Wrong. Bell's Best Brown, Wrong. Lost Coast Downtown Brown, W% Lost Coast Downtown Brown, Q1 Which action will help avoid DMS in the finished beer? Wrong. Boil the wort with the cover on, Right. Cool the wort quickly, Wrong. Prevent evaporization of boiling wort, Wrong. add cinnamon, Wrong. stir wort often, Q1 Hop bitterness in beer comes primarily from what? Wrong. tannins, Wrong. essential oils, Right. hop resins, Wrong. scorching the wort, Wrong. myrcene Q1 Boiling Fuggle hops for 10 minutes will do which of the following: Wrong. drive off essential oils, Wrong. isomerize Cohumulone, Wrong. give a herbal aroma, Right. all of the above, Q1 Sniff the entry immediately after pouring to ensure proper evaluation of volatile aromatics. Right. True, Wrong. False, Q1 Which of the following is NOT a purpose of the BJCP? Right. standardize beer styles, Wrong. promote the appreciation of real beer, Wrong. promote beer literacy, Wrong. recognize beer tasting and evaluation skills, Q1 To acheive a judge designation of Apprentice, what score on the test is required? Wrong. 90-100, Wrong. 80-89, Wrong. 70-79, Wrong. 60-69, Right. <60, Q1 To acheive a judge designation of Recognized, what score on the test is required? Wrong. 90-100, Wrong. 80-89, Wrong. 70-79, Right. 60-69, Wrong. <60, Q1 To acheive a judge designation of Certified, what score on the test is required? Wrong. 90-100, Wrong. 80-89, Right. 70-79, Wrong. 60-69, Wrong. <60, Q1 To acheive a judge designation of National, what score on the test is required? Wrong. 90-100, Right. 80-89, Wrong. 70-79, Wrong. 60-69, Wrong. <60, Q1 To acheive a judge designation of Master or above, what score on the test is required? Right. 90-100, Wrong. 80-89, Wrong. 70-79, Wrong. 60-69, Wrong. <60, Q1 To acheive a judge designation of Apprentice, how many experience points are required? Wrong. 50, Wrong. 40, Wrong. 20, Wrong. 5, Right. none, Q1 To acheive a judge designation of Recognized, how many experience points are required? Wrong. 50, Wrong. 40, Wrong. 20, Wrong. 5, Right. none, Q1 To acheive a judge designation of Certified, how many experience points are required? Wrong. 100, Wrong. 50, Wrong. 40, Wrong. 20, Right. 5, Q1 To acheive a judge designation of National, how many experience points are required? Wrong. 100, Wrong. 50, Wrong. 40, Right. 20, Wrong. 5, _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Put the variables you want to pass around in the main class. class qandagui NbrFrames = Rexx TomString = 1
Start by getting a new instance of yourself (main class) method main(s=String[]) static
qandagui(s) method qandagui(s) say 'Executing the latest code on' date() source say this.NbrFrames
From: [hidden email] [mailto:[hidden email]]
On Behalf Of [hidden email]
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Rony G. Flatscher (wu-wien)
Hello Rony, many thanks for the testcase.
The correct answer *should be*: call process number, "17.71" ------------------------------^ line 3: error: Expected Number This is detected in the semantic analysis of Rexx2Nrx, by the Type detection algorithms. I will, however, have to re-test it when I'm thru with the new 7.00 version. Have a nice day, Thomas. PS: My personal opinion goes along this thread, but I do NOT like to fight with anybody about this... My decision and opinion is simply based on more than 40 years of programming in various languages ;-) ========================================================= Am 18.10.2011 17:49, schrieb Rony G. Flatscher: Thomas, --
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
In reply to this post by kenner
Hello Kenneth, *and all*:
Your example program does raise an *interesting question*: In which CONTEXTS is 'source' recognized as a known symbol ? Is this specified anywhere in nrl3.def ? I (personally) thought it is only allowed in 'parse source' ! Please advise... Thomas. PS: Kenneth, I also do see that you did comment out t1=time('R'). May I advise, that my RexxTime class (already in the org.netrexx repository on KENAI under org.netrexx.thsitc.runtime.compatibility, class RexxTime, *does implement* the date(...) and time(...) functionality as specified in classic or Open Object Rexx.! Usage is: import org.netrexx.thsitc.runtime.compatibility class qandagui USES RexxTime t1=time('R') Note the usage of the (far too less used USES keyword of NetRexx!) Thomas Schneider. ===================================================== Am 18.10.2011 18:56, schrieb [hidden email]
--
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
In reply to this post by ThSITC
Thomas:
On 19.10.2011 12:27, Thomas Schneider wrote: Hello Rony, many thanks for the testcase.no matter how many years of programming one has, it is important what language concepts one is able to overlook and to apply. There are issues which cannot be resolved by "personal feelings" of one individual or another, hence such "feelings" cannot qualify, if decisions have to be undertaken. In this particular discussion you probably need to be fully aware of the concepts of the Rexx language (and ooRexx language, if you claim to be able to deal with it as well) and the NetRexx language. --- In your answer you did not show a NetRexx version of the Rexx program, so here is one (the original Rexx program is at the end of this mail): say "enter a number"--- If you run this NetRexx program and supply the value "1" via the keyboard the following output is generated: F:\test\schneider>NetRexxC -exec test.nrxIf you run the Rexx program given in my original e-mail ("challenge") below and supply the value "1" via the keyboard the following output is generated using ooRexx: F:\test\schneider>rexx test.rexSo both, Rexx and NetRexx behave the same! --- If you run this NetRexx program and supply the value "abc" via the keyboard the following output is generated: F:\test\schneider>NetRexxC -exec test.nrxIf you run the Rexx program given in my original e-mail ("challenge") below and supply the value "abc" via the keyboard the following output is generated using ooRexx: F:\test\schneider>rexx test.rexSo both, Rexx and NetRexx behave the same! --- As you can see, just by experimenting a little bit would you become able to not depend on "feelings" anymore. :) --- You should really look into this simple Rexx program and one of its NetRexx representations, and also reread the Rexx (and NetRexx) design principles and language specifications as only then would you be able to fully understand, why a Rexx value can be a number [and among other things why that possibility is so important for the (easiness) of the programming language(s)]. ---rony
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Mike Cowlishaw
On 10/16/2011 11:55 AM, Mike Cowlishaw wrote:
Or, to put it another way, "It's comforting to realize that it really was an oncoming train." (Or: "Is that really a train's tail light?" Tom. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Hind-sight trumps foresight and Planning every time. . .
BobH Richardson Texas USA On Sat, Oct 22, 2011 at 12:11 AM, Tom Maynard <[hidden email]> wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Tom Maynard
International Technical Support Organization Creating Java Applications Using NetRexx September 1997 Or is this obsolete? Is there some tutorial that I would benefit from faster? My goal is to convert some netrexx text oriented programs to a gui interface (currently on Windoze xp). _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Kenneth,
this is a good book but as you already suspected, the GUI section is outdated - that is to say, everything in it still works (like AWT GUIs) but you would want to look into Swing userinterfaces, or even JavaFX (or a hundred other possibilities, fow which I am probably opening the door to be discussed on the mailing list). What I personally did in a number of projects, was to use NetBeans for the work of drawing the userinterface (assembling the parts of it on a canvans, creating the dialog boxes etc) and let it create the event loop for you, and in there use NetRexx classes to do the actual work. The good integration between the two languages make for an enjoyable time doing that. The added benefit when you do it this way is, that you can reuse the NetRexx classes if the need for another interface pops up, like a JFC web interface for example. best regards, René On Tue, 25 Oct 2011 09:43:24 -0400, [hidden email] wrote: > International Technical Support Organization > CREATING JAVA APPLICATIONS USING NETREXX > September 1997 > > Or is this obsolete? Is there some tutorial that I would benefit from > faster? My goal is to convert some netrexx text oriented programs to > a > gui interface (currently on Windoze xp). _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Strange that this should come up today - I am looking (as of today) at WindowBuilder in Eclipse and doing the "real" work in NetRexx, much as René suggests
As an observation, The WindowBuilder guys reckon that their model should be extensible to any language where an Eclipse AST exists, so we may, eventually, be in a position to go native with a visual GUI designer. Dave. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of rvjansen Sent: 25 October 2011 16:28 To: IBM Netrexx Subject: Re: [Ibm-netrexx] Should I bother getting "package Redbook" to work? Kenneth, this is a good book but as you already suspected, the GUI section is outdated - that is to say, everything in it still works (like AWT GUIs) but you would want to look into Swing userinterfaces, or even JavaFX (or a hundred other possibilities, fow which I am probably opening the door to be discussed on the mailing list). What I personally did in a number of projects, was to use NetBeans for the work of drawing the userinterface (assembling the parts of it on a canvans, creating the dialog boxes etc) and let it create the event loop for you, and in there use NetRexx classes to do the actual work. The good integration between the two languages make for an enjoyable time doing that. The added benefit when you do it this way is, that you can reuse the NetRexx classes if the need for another interface pops up, like a JFC web interface for example. best regards, René On Tue, 25 Oct 2011 09:43:24 -0400, [hidden email] wrote: > International Technical Support Organization > CREATING JAVA APPLICATIONS USING NETREXX > September 1997 > > Or is this obsolete? Is there some tutorial that I would benefit from > faster? My goal is to convert some netrexx text oriented programs to > a > gui interface (currently on Windoze xp). _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Is Netrexxify also no longer supported? How about RexxVerA.nrx? I find links and no joy. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Dave Woodman
Also strange - I had just added a change request to Kenai to add Swing
to the default NetRexx imports to make graphics use a bit easier. But I was worried that Eclipse users might object if they were using SWT instead of Swing. Is that an issue? Is the AST a language definition? Didn't Bill create something like that for the Eclipse plugin? -- Kermit On 10/25/2011 9:12 AM, Dave Woodman wrote: > Strange that this should come up today - I am looking (as of today) at WindowBuilder in Eclipse and doing the "real" work in NetRexx, much as René suggests > > As an observation, The WindowBuilder guys reckon that their model should be extensible to any language where an Eclipse AST exists, so we may, eventually, be in a position to go native with a visual GUI designer. > > Dave. > > -----Original Message----- > From: [hidden email] [mailto:[hidden email]] On Behalf Of rvjansen > Sent: 25 October 2011 16:28 > To: IBM Netrexx > Subject: Re: [Ibm-netrexx] Should I bother getting "package Redbook" to work? > > Kenneth, > > > this is a good book but as you already suspected, the GUI section is > outdated - that is to say, everything in it still works (like AWT GUIs) > but you would want to look into Swing userinterfaces, or even JavaFX (or > a hundred other possibilities, fow which I am probably opening the door > to be discussed on the mailing list). > > What I personally did in a number of projects, was to use NetBeans for > the work of drawing the userinterface (assembling the parts of it on a > canvans, creating the dialog boxes etc) and let it create the event loop > for you, and in there use NetRexx classes to do the actual work. The > good integration between the two languages make for an enjoyable time > doing that. > > The added benefit when you do it this way is, that you can reuse the > NetRexx classes if the need for another interface pops up, like a JFC > web interface for example. > > best regards, > > René > > > On Tue, 25 Oct 2011 09:43:24 -0400, [hidden email] > wrote: >> International Technical Support Organization >> CREATING JAVA APPLICATIONS USING NETREXX >> September 1997 >> >> Or is this obsolete? Is there some tutorial that I would benefit from >> faster? My goal is to convert some netrexx text oriented programs to >> a >> gui interface (currently on Windoze xp). > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > > > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > > > _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
AST = Abstract Syntax Tree - an in-core representation of the program after it has been parsed.
My thoughts were exactly that Bill's work could bear bonus fruit - once the WindowBuilder guys have generalised their tool. Dave. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Kermit Kiser Sent: 25 October 2011 21:29 To: IBM Netrexx Subject: Re: [Ibm-netrexx] Should I bother getting "package Redbook" to work? Also strange - I had just added a change request to Kenai to add Swing to the default NetRexx imports to make graphics use a bit easier. But I was worried that Eclipse users might object if they were using SWT instead of Swing. Is that an issue? Is the AST a language definition? Didn't Bill create something like that for the Eclipse plugin? -- Kermit On 10/25/2011 9:12 AM, Dave Woodman wrote: > Strange that this should come up today - I am looking (as of today) at WindowBuilder in Eclipse and doing the "real" work in NetRexx, much as René suggests > > As an observation, The WindowBuilder guys reckon that their model should be extensible to any language where an Eclipse AST exists, so we may, eventually, be in a position to go native with a visual GUI designer. > > Dave. > > -----Original Message----- > From: [hidden email] [mailto:[hidden email]] On Behalf Of rvjansen > Sent: 25 October 2011 16:28 > To: IBM Netrexx > Subject: Re: [Ibm-netrexx] Should I bother getting "package Redbook" to work? > > Kenneth, > > > this is a good book but as you already suspected, the GUI section is > outdated - that is to say, everything in it still works (like AWT GUIs) > but you would want to look into Swing userinterfaces, or even JavaFX (or > a hundred other possibilities, fow which I am probably opening the door > to be discussed on the mailing list). > > What I personally did in a number of projects, was to use NetBeans for > the work of drawing the userinterface (assembling the parts of it on a > canvans, creating the dialog boxes etc) and let it create the event loop > for you, and in there use NetRexx classes to do the actual work. The > good integration between the two languages make for an enjoyable time > doing that. > > The added benefit when you do it this way is, that you can reuse the > NetRexx classes if the need for another interface pops up, like a JFC > web interface for example. > > best regards, > > René > > > On Tue, 25 Oct 2011 09:43:24 -0400, [hidden email] > wrote: >> International Technical Support Organization >> CREATING JAVA APPLICATIONS USING NETREXX >> September 1997 >> >> Or is this obsolete? Is there some tutorial that I would benefit from >> faster? My goal is to convert some netrexx text oriented programs to >> a >> gui interface (currently on Windoze xp). > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > > > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > > > _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Free forum by Nabble | Edit this page |