On Sun, Oct 13, 2013 at 7:45 PM, Mark Miesfeld <miesfeld@gmail.com> wrote:

I didn't proof read this well enough.  My second approach should have the init() method totally removed.
 
I usually take the second approach and would do something like this:


/* Simple RcDialog template */
use arg cmdLine

  if cmdLine~words <> 2 then do
    say 'Syntax: somePrg param1 param2'
    return 99
  end

  param1 = cmdLine~word(1)
  param2 = cmdLine~word(2)

  dlg = .SimpleRcDlg~new("simple.rc", IDD_SIMPLE_DLG, , "simple.h")
  dlg~setArgs(param1, param2)
  
  dlg~execute("SHOWTOP", IDI_DLG_OOREXX)

return 0
-- End of entry point.

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*\
  Directives, Classes, or Routines.
\* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
::requires "ooDialog.cls"

::class 'SimpleRcDlg' subclass RcDialog

::attribute param1
::attribute param2

::method init
  use arg rcFile, id, dlgData., hFile, param1, param2

  self~init:super(rcFile, id, , hFile)

::method setArgs
  use strict arg p1, p2
  self~param1 = p1
  self~parma2 = p2
  
::method initDialog

  if self~param1 == 'cat' then do
    -- do something
  end
  
  -- use param2 for something ...  


Remove the part in red altogether.

--
Mark Miesfeld