OOrexx dialog questions - REXX

This is a discussion on OOrexx dialog questions - REXX ; Hello All, I am trying to learn OOrexx on a Windows Vista os and have some questions regarding dialogs, methods, and passing variables between them. I have written the sample code below that sets up a number of cells and ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

OOrexx dialog questions

  1. Default OOrexx dialog questions

    Hello All,
    I am trying to learn OOrexx on a Windows Vista os and have some
    questions
    regarding dialogs, methods, and passing variables between them.
    I have written the sample code below that sets up a number of cells
    and adds them by line
    and by row. Currently I am adding all my row and line totals in the
    predialog field.
    All my variables are stored in stem a.
    Here are my questions
    I am using variable a.zed to set the numbers of rows and lines it
    allows me to change
    the rows and lines from 1 to 9, I pass the a. values to method INIT
    and the dialog screen size is set using a.zed as a multiplier
    I then move on to method definedialog but the value of a.zed is lost
    (I am using var zed in place)
    however I am able to add all my self~Addentrylines using the other a.
    values.
    1.What am I doing wrong?

    2.Currently I am adding all my row and line totals in the predialog
    field
    and passing along in the a. stem
    I should be doing this in the dialog somewhere but I
    don't know which method to use I tried method init and method
    initdialog
    but couldn't get anything to work. It took 3 days just to get the code
    below
    to work

    3. I want to add a method reset so that I can change values in the
    cells and
    recalculate the line and row totals. How can I accomplish this?

    Any help would be greatly appreciated, I hope this code is readable
    **********************************************************************************************
    /***/
    DO K=1 TO 400 /*set up a stem variables*/
    a.K= 0
    END

    a.21=right(date(),4)

    a.101 = 5.88
    a.102 = 39.50
    a.103 = 49.17
    a.109 = 11.22
    a.111 = 303.59
    a.112 = 0
    a.113 = 28.75
    a.121 = 1215.66
    a.122 = 643.98
    a.125 = 32.76
    a.zed=9

    /**************************adding lines and
    rows****************************/
    do k=0 to a.zed

    do j=0 to 8
    interpret 'a.1'j'0=a.1'j'0+a.1'j||k /*set up line
    totals (a.100=a.100+a.101+a.103,)(a.110=a.110+a.111+,,,etc)*/
    interpret 'a.3'k'=a.3'k'+a.1'j||k /*set up row
    totals (a.30=a.30+a.100)(a.31=a.31+a.101),,,etc)*/
    end

    interpret 'a.40=a.40+a.1'k'0' /*set up total
    for all( a.40=a.40+a.110)*/

    END
    /**************************adding lines and
    rows****************************/

    MyDialog=.MyDlgClass~new(a.)


    MyDialog~Execute('ShowTop')
    MyDialog~DeInstall
    exit
    /***************start dialog*******************************/
    ::requires 'oodwin32.cls'


    ::class MyDlgClass subclass userdialog

    ::method Init
    expose a.
    use arg a.
    w1=53* a.zed
    self~Init:super(a.)
    width=(53*a.zed)+100 ; height=(30*a.zed)
    +100 /*dialog screen*/
    rc=self~CreateCenter(width,height,'Test form',,,,
    'MS Sans Serif',8)
    self~InitCode=(rc=0)


    ::method DefineDialog
    expose a.
    use arg a.
    self~DefineDialog:super(a.)

    /***Set Year ***/

    self~AddText(5, 08 ,85 , 8,'Year')
    self~AddEntryLine(21,"d",25, 05 ,20 ,12,"right","Number",'&a.21')

    /***************Set values cells rows lines***********/

    zed =9 /*sets number of rows and lines
    maximum=9*****/
    down=30
    alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    n=90
    DO k=1 to zed
    tab=10
    down=down+15
    n=n+10
    p=substr(alpha,k,1)
    self~AddText(tab,down+3,20, 8,'Line 'p )

    Do j=1 to zed
    i=n+j
    tab=tab+40
    self~AddText(tab+9,30 ,25, 8,'Row 'j )
    self~AddEntryLine(i,edit,tab,down,35,
    12,"right","number",'&a.i' ) /*set cells values*/
    End

    self~AddEntryLine(n,edit,tab+45,down,35,
    12,"right","number",'&a.n' ) /*set line values*/
    END

    self~AddBlackRect(45,42,tab-5,down-25)
    self~AddText(tab+48,30 ,40, 8,'Line totals' )
    tab=10
    down=down+30

    DO j=1 to zed
    i=j+30
    tab=tab+40
    self~AddEntryLine(i,edit,tab,down ,35,
    12,"right","number",'&a.i' ) /*set row values*/
    END
    self~AddText(10,down ,40 , 8,'Row Totals')

    tab=tab+45
    self~AddText(tab+8,down-10 ,40 , 8,'TOTAL')
    self~AddEntryLine(40,edit,tab,down ,35, 12,"right","number",'&a.
    40' ) /*set total value*/


    self~AddButton( 1,Self~SizeX-180,Self~SizeY-40,50,15,'OK','Ok','DEFAULT')

    self~AddButton( 2,Self~SizeX-120,Self~SizeY-40,50,15,'Cancel','Cancel')

    self~AddButton( 3,Self~SizeX-60,Self~SizeY-40,50,15,'Reset','Reset')
    if ret = 0 then do
    self~ConnectButton( 3, "reset",a.)
    end


    ::method InitDialog
    expose a.
    use arg a.

    self~InitDialog:super(a.)


    ::method reset
    expose a.
    use arg a.


  2. Default Re: OOrexx dialog questions

    Just a guess, but try removing the "use arg a." from InitDialog and
    DefineDialog. If those methods are not getting passed a stem value as
    an argument (and I suspect they're not), this will wipe out the value of
    the variable a. The "expose a." is all you need in those methods to
    access the variable.

    Rick

    globaloney wrote:
    > Hello All,
    > I am trying to learn OOrexx on a Windows Vista os and have some
    > questions
    > regarding dialogs, methods, and passing variables between them.
    > I have written the sample code below that sets up a number of cells
    > and adds them by line
    > and by row. Currently I am adding all my row and line totals in the
    > predialog field.
    > All my variables are stored in stem a.
    > Here are my questions
    > I am using variable a.zed to set the numbers of rows and lines it
    > allows me to change
    > the rows and lines from 1 to 9, I pass the a. values to method INIT
    > and the dialog screen size is set using a.zed as a multiplier
    > I then move on to method definedialog but the value of a.zed is lost
    > (I am using var zed in place)
    > however I am able to add all my self~Addentrylines using the other a.
    > values.
    > 1.What am I doing wrong?
    >
    > 2.Currently I am adding all my row and line totals in the predialog
    > field
    > and passing along in the a. stem
    > I should be doing this in the dialog somewhere but I
    > don't know which method to use I tried method init and method
    > initdialog
    > but couldn't get anything to work. It took 3 days just to get the code
    > below
    > to work
    >
    > 3. I want to add a method reset so that I can change values in the
    > cells and
    > recalculate the line and row totals. How can I accomplish this?
    >
    > Any help would be greatly appreciated, I hope this code is readable
    > **********************************************************************************************
    > /***/
    > DO K=1 TO 400 /*set up a stem variables*/
    > a.K= 0
    > END
    >
    > a.21=right(date(),4)
    >
    > a.101 = 5.88
    > a.102 = 39.50
    > a.103 = 49.17
    > a.109 = 11.22
    > a.111 = 303.59
    > a.112 = 0
    > a.113 = 28.75
    > a.121 = 1215.66
    > a.122 = 643.98
    > a.125 = 32.76
    > a.zed=9
    >
    > /**************************adding lines and
    > rows****************************/
    > do k=0 to a.zed
    >
    > do j=0 to 8
    > interpret 'a.1'j'0=a.1'j'0+a.1'j||k /*set up line
    > totals (a.100=a.100+a.101+a.103,)(a.110=a.110+a.111+,,,etc)*/
    > interpret 'a.3'k'=a.3'k'+a.1'j||k /*set up row
    > totals (a.30=a.30+a.100)(a.31=a.31+a.101),,,etc)*/
    > end
    >
    > interpret 'a.40=a.40+a.1'k'0' /*set up total
    > for all( a.40=a.40+a.110)*/
    >
    > END
    > /**************************adding lines and
    > rows****************************/
    >
    > MyDialog=.MyDlgClass~new(a.)
    >
    >
    > MyDialog~Execute('ShowTop')
    > MyDialog~DeInstall
    > exit
    > /***************start dialog*******************************/
    > ::requires 'oodwin32.cls'
    >
    >
    > ::class MyDlgClass subclass userdialog
    >
    > ::method Init
    > expose a.
    > use arg a.
    > w1=53* a.zed
    > self~Init:super(a.)
    > width=(53*a.zed)+100 ; height=(30*a.zed)
    > +100 /*dialog screen*/
    > rc=self~CreateCenter(width,height,'Test form',,,,
    > 'MS Sans Serif',8)
    > self~InitCode=(rc=0)
    >
    >
    > ::method DefineDialog
    > expose a.
    > use arg a.
    > self~DefineDialog:super(a.)
    >
    > /***Set Year ***/
    >
    > self~AddText(5, 08 ,85 , 8,'Year')
    > self~AddEntryLine(21,"d",25, 05 ,20 ,12,"right","Number",'&a.21')
    >
    > /***************Set values cells rows lines***********/
    >
    > zed =9 /*sets number of rows and lines
    > maximum=9*****/
    > down=30
    > alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    > n=90
    > DO k=1 to zed
    > tab=10
    > down=down+15
    > n=n+10
    > p=substr(alpha,k,1)
    > self~AddText(tab,down+3,20, 8,'Line 'p )
    >
    > Do j=1 to zed
    > i=n+j
    > tab=tab+40
    > self~AddText(tab+9,30 ,25, 8,'Row 'j )
    > self~AddEntryLine(i,edit,tab,down,35,
    > 12,"right","number",'&a.i' ) /*set cells values*/
    > End
    >
    > self~AddEntryLine(n,edit,tab+45,down,35,
    > 12,"right","number",'&a.n' ) /*set line values*/
    > END
    >
    > self~AddBlackRect(45,42,tab-5,down-25)
    > self~AddText(tab+48,30 ,40, 8,'Line totals' )
    > tab=10
    > down=down+30
    >
    > DO j=1 to zed
    > i=j+30
    > tab=tab+40
    > self~AddEntryLine(i,edit,tab,down ,35,
    > 12,"right","number",'&a.i' ) /*set row values*/
    > END
    > self~AddText(10,down ,40 , 8,'Row Totals')
    >
    > tab=tab+45
    > self~AddText(tab+8,down-10 ,40 , 8,'TOTAL')
    > self~AddEntryLine(40,edit,tab,down ,35, 12,"right","number",'&a.
    > 40' ) /*set total value*/
    >
    >
    > self~AddButton( 1,Self~SizeX-180,Self~SizeY-40,50,15,'OK','Ok','DEFAULT')
    >
    > self~AddButton( 2,Self~SizeX-120,Self~SizeY-40,50,15,'Cancel','Cancel')
    >
    > self~AddButton( 3,Self~SizeX-60,Self~SizeY-40,50,15,'Reset','Reset')
    > if ret = 0 then do
    > self~ConnectButton( 3, "reset",a.)
    > end
    >
    >
    > ::method InitDialog
    > expose a.
    > use arg a.
    >
    > self~InitDialog:super(a.)
    >
    >
    > ::method reset
    > expose a.
    > use arg a.
    >


  3. Default Re: OOrexx dialog questions

    On Oct 16, 2:28 pm, Rick McGuire <object.r...@gmail.com> wrote:
    > Just a  guess, but try removing the "use arg a." from InitDialog and
    > DefineDialog.  If those methods are not getting passed a stem value as
    > an argument (and I suspect they're not), this will wipe out the value of
    > the variable a.  The "expose a." is all you need in those methods to
    > access the variable.
    >
    > Rick
    >
    >
    >
    > globaloney wrote:
    > > Hello All,
    > > I am trying to learn OOrexx on a Windows Vista os and have some
    > > questions
    > > regarding dialogs, methods, and passing variables between them.
    > > I have written the sample code below that sets up a number of cells
    > > and adds them by line
    > > and by row. Currently I am adding all my row and line totals in the
    > > predialog field.
    > > All my variables are stored in stem a.
    > > Here are my questions
    > >  I am using  variable a.zed to set the numbers of rows and lines it
    > > allows me to change
    > > the rows and lines from 1 to 9, I pass the a. values to method INIT
    > > and the dialog screen size is set using a.zed as a multiplier
    > > I then move on to method definedialog but the value of a.zed is lost
    > > (I am using var zed in place)
    > > however I am able to add all my self~Addentrylines using the other a.
    > > values.
    > > 1.What am I doing wrong?

    >
    > > 2.Currently I am adding all my row and line totals in the predialog
    > > field
    > >  and passing along in the a. stem
    > > I should be doing this in the dialog somewhere but I
    > > don't know which method to use I tried method init and method
    > > initdialog
    > > but couldn't get anything to work. It took 3 days just to get the code
    > > below
    > > to work

    >
    > > 3. I want to add a method reset so that I can change values in the
    > > cells and
    > > recalculate the line and row totals. How can I accomplish this?

    >
    > > Any help would be greatly appreciated, I hope this code is readable
    > > ***************************************************************************­*******************
    > >    /***/
    > > DO K=1 TO 400                         /*set up a stem variables*/
    > >   a.K= 0
    > >   END

    >
    > > a.21=right(date(),4)

    >
    > > a.101 =      5.88
    > > a.102 =     39.50
    > > a.103 =     49.17
    > > a.109 =     11.22
    > > a.111 =    303.59
    > > a.112 =         0
    > > a.113 =     28.75
    > > a.121 =   1215.66
    > > a.122 =    643.98
    > > a.125 =     32.76
    > > a.zed=9

    >
    > >  /**************************adding lines and
    > > rows****************************/
    > >  do k=0 to a.zed

    >
    > >         do j=0 to 8
    > >           interpret 'a.1'j'0=a.1'j'0+a.1'j||k           /*set up line
    > > totals (a.100=a.100+a.101+a.103,)(a.110=a.110+a.111+,,,etc)*/
    > >           interpret 'a.3'k'=a.3'k'+a.1'j||k            /*set up row
    > > totals  (a.30=a.30+a.100)(a.31=a.31+a.101),,,etc)*/
    > >         end

    >
    > >  interpret 'a.40=a.40+a.1'k'0'                          /*set up total
    > > for all( a.40=a.40+a.110)*/

    >
    > >  END
    > >  /**************************adding lines and
    > > rows****************************/

    >
    > > MyDialog=.MyDlgClass~new(a.)

    >
    > > MyDialog~Execute('ShowTop')
    > > MyDialog~DeInstall
    > > exit
    > > /***************start dialog*******************************/
    > > ::requires 'oodwin32.cls'

    >
    > > ::class MyDlgClass subclass userdialog

    >
    > > ::method Init
    > > expose a.
    > > use arg a.
    > > w1=53* a.zed
    > >   self~Init:super(a.)
    > >   width=(53*a.zed)+100 ; height=(30*a.zed)
    > > +100                         /*dialog screen*/
    > >   rc=self~CreateCenter(width,height,'Test form',,,,
    > >                                    'MS Sans Serif',8)
    > >   self~InitCode=(rc=0)

    >
    > > ::method DefineDialog
    > > expose a.
    > > use arg a.
    > >   self~DefineDialog:super(a.)

    >
    > >     /***Set Year ***/

    >
    > >     self~AddText(5, 08 ,85 , 8,'Year')
    > >     self~AddEntryLine(21,"d",25, 05 ,20 ,12,"right","Number",'&a.21')

    >
    > > /***************Set values cells rows lines***********/

    >
    > > zed =9                                 /*sets number of rows and lines
    > > maximum=9*****/
    > > down=30
    > > alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    > > n=90
    > >  DO k=1 to  zed
    > >               tab=10
    > >               down=down+15
    > >               n=n+10
    > >               p=substr(alpha,k,1)
    > >               self~AddText(tab,down+3,20, 8,'Line 'p )

    >
    > >               Do j=1 to zed
    > >                           i=n+j
    > >                           tab=tab+40
    > >                           self~AddText(tab+9,30 ,25, 8,'Row 'j   )
    > >                           self~AddEntryLine(i,edit,tab,down,35,
    > > 12,"right","number",'&a.i' )            /*set cells values*/
    > >               End

    >
    > >               self~AddEntryLine(n,edit,tab+45,down,35,
    > > 12,"right","number",'&a.n' )                     /*set line values*/
    > >  END

    >
    > >  self~AddBlackRect(45,42,tab-5,down-25)
    > >  self~AddText(tab+48,30 ,40, 8,'Line totals' )
    > >  tab=10
    > >  down=down+30

    >
    > >  DO j=1 to zed
    > >               i=j+30
    > >               tab=tab+40
    > >               self~AddEntryLine(i,edit,tab,down ,35,
    > > 12,"right","number",'&a.i' )                      /*set row values*/
    > >  END
    > >                   self~AddText(10,down ,40 , 8,'Row Totals')

    >
    > >   tab=tab+45
    > >                   self~AddText(tab+8,down-10 ,40 , 8,'TOTAL')
    > >   self~AddEntryLine(40,edit,tab,down ,35, 12,"right","number",'&a.
    > > 40' )                                  /*set total value*/

    >
    > > self~AddButton( 1,Self~SizeX-180,Self~SizeY-40,50,15,'OK','Ok','DEFAULT')

    >
    > > self~AddButton( 2,Self~SizeX-120,Self~SizeY-40,50,15,'Cancel','Cancel')

    >
    > > self~AddButton( 3,Self~SizeX-60,Self~SizeY-40,50,15,'Reset','Reset')
    > >   if ret = 0 then do
    > >     self~ConnectButton( 3, "reset",a.)
    > >   end

    >
    > > ::method InitDialog
    > > expose a.
    > > use arg a.

    >
    > >  self~InitDialog:super(a.)

    >
    > > ::method reset
    > > expose a.
    > > use arg a.- Hide quoted text -

    >
    > - Show quoted text -


    Thanks but that didn't work , removing the use arg a. didn't pass
    a.zed at all.
    I cleaned up my code by removing the ::method DefineDialog and moved
    all my line and row additions into the init method.
    Putting in a few 'say a.zed' statements I noticed that the value of
    a.zed dropped after the first self~addEntryline statement. I think I
    read that variables below 20 shouldn't be used so i now set zed=a.zed
    near the top of the method init.

    So I have my first to questions answered now all I need to know id how
    to reinit and recalculate the values on a reset.

  4. Default Re: OOrexx dialog questions



    I should add I needed the use arg a. statement only in method init,
    but you were correct in having me remove the statement in subsequent
    methods. I can now see my a. stem variables passed .
    Thanks for that tip it clears up my misunderstanding of those
    statements. below is the cleaned up code
    ****************************************************************************************************************************************
    /***/
    arg inp
    if inp='' then inp=9
    DO K=1 TO 400 /*set up a stem variables*/
    a.K= 0
    END

    a.21=right(date(),4)

    a.101 = 5.88
    a.102 = 39.50
    a.103 = 49.17
    a.109 = 11.22
    a.111 = 303.59
    a.112 = 0
    a.113 = 28.75
    a.121 = 1215.66
    a.122 = 643.98
    a.125 = 32.76
    a.zed=inp


    MyDialog=.MyDlgClass~new(a.)


    MyDialog~Execute('ShowTop')
    MyDialog~DeInstall
    exit
    /***************start dialog*******************************/
    ::requires 'oodwin32.cls'


    ::class MyDlgClass subclass userdialog

    ::method Init
    expose a.
    use arg a.
    zed=a.zed
    yed=zed-1
    self~Init:super(a.)
    width=(53*zed)+100 ; height=(30*zed)+100 /
    *dialog screen*/
    rc=self~CreateCenter(width,height,'Test form',,,,
    'MS Sans Serif',8)
    self~InitCode=(rc=0)

    /**************************adding lines and
    rows****************************/
    do k=0 to zed

    do j=0 to yed
    interpret 'a.1'j'0=a.1'j'0+a.1'j||k /*set up line
    totals */
    interpret 'a.3'k'=a.3'k'+a.1'j||k /*set up row
    totals */
    end

    interpret 'a.40=a.40+a.1'k'0' /*set up total
    for all*/

    END
    /**************************adding lines and
    rows****************************/


    /***Set Year ***/

    self~AddText(5, 08 ,85 , 8,'Year')
    self~AddEntryLine(21,"d",25, 05 ,20 ,12,"right","Number",'&a.21')

    /***************Set values cells rows lines***********/
    down=30
    alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    n=90
    DO k=1 to zed
    tab=10
    down=down+15
    n=n+10
    p=substr(alpha,k,1)
    self~AddText(tab,down+3,20, 8,'Line 'p )

    Do j=1 to zed
    i=n+j
    tab=tab+40
    self~AddText(tab+9,30 ,25, 8,'Row 'j )
    self~AddEntryLine(i,edit,tab,down,35,
    12,"right","number",'&a.i' ) /*set cells values*/
    End

    self~AddEntryLine(n,edit,tab+45,down,35,
    12,"right","number",'&a.n' ) /*set line values*/
    END

    self~AddBlackRect(45,42,tab-5,down-25)
    self~AddText(tab+48,30 ,40, 8,'Line totals' )
    tab=10
    down=down+30

    DO j=1 to zed
    i=j+30
    tab=tab+40
    self~AddEntryLine(i,edit,tab,down ,35,
    12,"right","number",'&a.i' ) /*set row values*/
    END
    self~AddText(10,down ,40 , 8,'Row Totals')

    tab=tab+45
    self~AddText(tab+8,down-10 ,40 , 8,'TOTAL')
    self~AddEntryLine(40,edit,tab,down ,35, 12,"right","number",'&a.
    40' ) /*set total value*/


    self~AddButton( 1,Self~SizeX-180,Self~SizeY-40,50,15,'OK','Ok','DEFAULT')

    self~AddButton( 2,Self~SizeX-120,Self~SizeY-40,50,15,'Cancel','Cancel')

    self~AddButton( 3,Self~SizeX-60,Self~SizeY-40,50,15,'Reset','Reset')
    if ret = 0 then do
    self~ConnectButton( 3, "reset",a.)
    end


    ::method InitDialog
    expose a.
    self~InitDialog:super(a.)


    ::method reset
    expose a.
    say a.21


  5. Default Re: OOrexx dialog questions

    On Oct 16, 1:47 pm, globaloney <jgol...@excite.com> wrote:

    > I should add I needed the use arg a. statement only in method init,


    Hi,

    Your program had a number of problems with it. I rewrote it so it
    works and will post it below. I reformatted it and used some
    continuation lines so that it won't wrap.

    I'll try to clear up some misconceptions here, but it would probably
    be best if you looked at the places where I changed your code, and
    then asked specific questions on those places. Then I can explain
    myself in smaller chunks.

    1.) The first arg to new for ooDialogs is to be a stem. ooDialog
    uses the values in the stem to set up certain aspects of the controls.

    I don't like this at all, and never use it. It's okay if you are
    going to do a very simple dialog. As soon as you start to do more
    sophisticated things you quickly run into problems.

    My advice here is to keep your data variable separate from the arg 1
    stem. Then set up your controls yourself. I said previously that I
    would post some ways to send arguments to your dialog, and then I
    didn't follow up. ;-(

    The whole working program is below, but here are some snippets:

    You could send your stem to your dialog class this way:

    MyDialog=.MyDlgClass~new( , , a.)

    You are omitting the first two args and sending your stem as the 3rd
    arg.

    Then your init() method looks like this:

    ::method Init
    expose a.

    forward class (super) continue

    a. = arg(3)
    zed=a.zed
    ...

    That initializes the super class and then you grab your stem and save
    it.

    We can simply forward the message (the init message) as is to the
    super class (which is UseDialog) because UserDialog ignores any args
    after the first 2.

    Here is the complete program. You can either post some questions on
    it, or I'll try to follow up with some pointers to help clarify how
    ooDialog works.

    /* TableValues.rex */
    arg inp
    if inp='' then inp=9


    /*set up a stem variables*/
    DO i = 1 TO 30
    do j = 1 to 30
    a.i.j = 0
    end
    END

    a.1.1 = 5.88
    a.1.2 = 39.50
    a.1.3 = 49.17
    a.1.9 = 11.22
    a.2.1 = 303.59
    a.2.2 = 0
    a.2.3 = 28.75
    a.3.1 = 1215.66
    a.3.2 = 643.98
    a.3.5 = 32.76
    a.zed=inp


    MyDialog=.MyDlgClass~new( , , a.)
    if MyDialog~initCode == 0 then do
    MyDialog~Execute('ShowTop')
    MyDialog~DeInstall
    end
    else do
    say 'Error initializing'
    say 'Aborting'
    end
    exit

    /***************start dialog*******************************/
    ::requires 'oodwin32.cls'

    ::class MyDlgClass subclass userdialog

    ::method Init
    expose a.

    forward class (super) continue

    a. = arg(3)
    zed=a.zed

    /*dialog screen*/
    x=(53*zed)+100 ; y=(30*zed)+100
    ret=self~CreateCenter(x,y, -
    'Test form', , ,'MS Sans Serif', 8)
    self~InitCode=(ret=0)


    -- We will set the control values ourselves.
    ::method initAutoDetection
    self~noAutoDetection

    ::method defineDialog
    expose a.

    zed=a.zed

    -- Add the year field
    self~AddText(5, 08 ,85 , 8,'Year')
    self~AddEntryLine(21,"d",25,05,20,12,"right")

    down=30
    alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    n=90
    DO k=1 to zed
    tab=10
    down=down+15

    idBase = k * 100

    p=substr(alpha,k,1)
    self~AddText(tab,down+3,20, 8,'Line 'p )

    Do j=1 to zed
    -- Add cell field
    cellId = idBase + j
    tab=tab+40
    self~AddText(tab+9,30 ,25, 8,'Row 'j )
    self~AddEntryLine(cellId, , tab,down,35,12,"right")
    end

    -- Add line total field
    lineTotalId = idBase + 50
    self~AddEntryLine(lineTotalId, ,tab+45,down,35,12,"right")
    end

    self~AddBlackRect(45,42,tab-5,down-25)
    self~AddText(tab+48,30 ,40, 8,'Line totals' )
    tab=10
    down=down+30

    rowTotalIdBase = (zed + 2) * 100
    DO j=1 to zed
    -- Add row total fields
    rowTotalId = rowTotalIdBase + j
    tab=tab+40
    self~AddEntryLine(rowTotalId, ,tab,down,35,12,"right")
    end

    -- Add overall total field
    totalTotalId = 40
    self~AddText(10,down ,40 , 8,'Row Totals')
    tab=tab+45
    self~AddText(tab+8,down-10 ,40 , 8,'TOTAL')
    self~AddEntryLine(totalTotalId, ,tab,down ,35,12, "right")

    -- Add the push buttons
    self~AddButton(1,Self~SizeX-180,Self~SizeY-40, -
    50,15,'OK','Ok','DEFAULT')

    self~AddButton(2,Self~SizeX-120,Self~SizeY-40, -
    50,15,'Cancel','Cancel')

    self~AddButton(3,Self~SizeX-60,Self~SizeY-40, -
    50,15,'Reset', onReset)

    self~ConnectButton(3, "reset")

    ::method InitDialog
    expose a.

    zed=a.zed
    yed=zed-1

    -- Set the year field
    self~setEntryLine(21, right(date(),4))

    -- Set the cell and line total fields.
    totalTotal = 0

    do i = 1 to zed
    lineTotal = 0
    idBase = i * 100

    do j = 1 to zed
    cellId = idBase + j
    cellValue = a.i.j
    self~setEntryLine(cellId, cellValue)

    lineTotal = lineTotal + cellValue
    end

    lineTotalId = idBase + 50
    self~setEntryLine(lineTotalId, lineTotal)

    totalTotal = totalTotal + lineTotal
    end

    -- Set the row total fields
    rowTotalIdBase = (zed + 2) * 100
    DO j=1 to zed
    rowTotal = 0
    do i = 1 to zed
    rowTotal = rowTotal + a.i.j
    end

    rowTotalId = rowTotalIdBase + j
    self~setEntryLine(rowTotalId, rowTotal)
    end

    -- Set the overall total field
    totalTotalId = 40
    self~setEntryLine(totalTotalId, totalTotal)


    ::method onReset
    expose a.
    say a.2.1



    --
    Mark Miesfeld

  6. Default Re: OOrexx dialog questions

    Hi Mark.
    Thanks for your time and expertise.
    I have the following questions

    What does this statement mean?


    forward class (super) continue

    Are we forwarding data into this method or the entire dialog?

    Is Super a class for the entire dialog?

    Is this where the a. stem variables are stored?

    How does it differ from this statement?

    self~Init:super(a.)

    *****************************************************************
    ::method initAutoDetection
    self~noAutoDetection

    how exactly does auto detection work?

    The documentation states:

    Automatic data field detection means that for every dialog data item
    a corresponding Object Rexx attribute is created automatically

    I am not clear on the concept.

    *****************************************************************

    In the defineDialog method we are using the down variable as a
    place marker
    for where the next line would be. How do I capture it if I need to
    use it in a
    subsequent method?

    Also if I create new A. stem variables in another method can I
    update A.
    or is that now closed off by the super invocation in the Init method?

    ********************************************************************
    And finally If I change or add any numbers to the cells how do I
    update
    the row totals, the line totals and the total?
    Do I copy all the calculation statements from the InitDialog method
    into the reset method?
    Thanks for your patience.

  7. Default Re: OOrexx dialog questions

    On Oct 17, 5:54 pm, globaloney <jgol...@excite.com> wrote:

    > I have the following questions
    >
    > What does this statement mean?
    >
    > forward class (super) continue


    It is better to look at the statement with a little context.

    ::method Init
    forward class (super) continue

    The forward instruction forwards the message that caused the method to
    be invoked, to some other destionation. You can change some things
    when you forward the message.

    So, the method is the init() method. The statement is not changing
    either the message itself, or the arguments. It is going to forward
    the init message to the superclass and then return and continue
    executing at the point after the statement.

    > Are we forwarding data into this method or the entire dialog?


    Essentially what this does is invoke the init() method of the
    superclass with the same arguments as the init() method of MyDlgClass
    was invoked with.

    > Is Super a class for the entire dialog?


    ::class MyDlgClass subclass userdialog

    You defined the MyDlgClass. Since it is a subclass of UserDialog,
    UserDialog is its direct superclass. In ooRexx, whenever you
    instantiate an object by using the new() method, the init() method of
    the object will get invoked with the args to new().

    So this statement:

    MyDialog=.MyDlgClass~new( , , a.)

    will cause the init() method of MyDlgClass to be invoked with those
    arguments. The first and the second args are omitted and the third
    arg will be the stem a.

    > Is this where the a. stem variables are stored?


    I'm not sure what you mean by that. In the code I wrote, the a. stem
    is not used by the UserDialog object, that was my whole point. The a.
    stem is used by your MyDlgClass object:

    MyDialog=.MyDlgClass~new( , , a.)
    ....
    ::method Init
    expose a.

    forward class (super) continue

    a. = arg(3)

    The third arg to ~new() is a. In the init() method of MyDlgClass I
    grab that third arg and store it in the exposed stem variable. So the
    stem variable is used by your MyDlgClass object, it is not used by the
    UserDialog object, because the UserDialog object only uses the first 2
    args, it ignores any third arg.


    > How does it differ from this statement?
    >
    > self~Init:super(a.)


    That statment invokes the UserDialog init() method with the stem
    variable as the *first* arg. Which, not to belabor the point, is
    exactly what I wanted to avoid. My advice was to separate out your
    data from the stem that gets sent to the superclass.

    This statement is the equivalent of the current code:

    self~Init:super( , , a.)

    But, the forward statement is more flexible because you can change the
    way you instantiate your new object without having to change your
    init() method.

    You could do this:

    -- a. is already initialized
    dlgData.21 = right(date(),4)

    MyDialog=.MyDlgClass~new( dlgData., , a.)

    and your init() method would still work correctly with no changes.

    --
    Mark Miesfeld

  8. Default Re: OOrexx dialog questions

    On Oct 17, 5:54 pm, globaloney <jgol...@excite.com> wrote:

    >  I have the following questions


    I'll try to answer all your questions, but I'm going to do it in
    separate posts.

    >  ::method initAutoDetection
    >    self~noAutoDetection
    >
    >    how exactly does auto detection work?


    I lump two things together under auto detection. Using a dialog data
    stem to set and get the state of the dialog controls and the creation
    of an attribute with the same name as the dialog control.

    Your dialog is too complicated to use as an example to explain this,
    so down below I'm attaching a simplier dialog to refer to.

    This is my statement, or premise if you will:

    Using auto detection works okay for very simple dialogs, but it
    quickly becomes cumbersome or breaks down completely when you try to
    go beyond very simple dialogs.

    Your original program is a perfect example of the truth of that
    premise (in my opinion.)

    1.) Using a dialog data stem is when you initialize a stem with the
    values to set the state of your dialog controls and pass that stem as
    the first arg to the new() method when you instantiate a dialog
    object. For each control, you use the resource ID of the control for
    the stem tail and set the value to what you want the matching control
    to be. For example, from the complete program below:

    data.101 = 0
    data.102 = 0
    data.103 = 1
    data.104 = 0
    data.110 = "New York"

    dlg = .PopQuiz~new(data.)

    With those statements above, what the ooDialog framework will do for
    you automatically, is set the state of the dialog control with
    resource ID of 101 to 0, set the control with ID of 102 to 0, etc.,
    and set the control with ID of 110 to New York.

    Then in defineDialog() I have this in the program:

    self~addRadioButton(101, "westRB", 18, 26, 61, 10, -
    "The West")

    That defines a radio button control with the resource ID of 101. By
    using the dialog data stem, ooDialog will automatically set the state
    of that radio button to unchecked. And because of this:

    data.103 = 1
    ....
    self~addRadioButton(103, "eastRB", 18, 66, 61, 10, -
    "The East")

    ooDialog will automatically set the state of that radio button
    checked.

    In addition, when you return from executing your dialog, ooDialog will
    have set the values of the stem variable to reflect the state of the
    controls when the user closed the dialog.

    If the user checked the radio button with ID of 101, then after the
    dialog ends:

    data.101 will equal 1, not 0.

    Here is the complete working program. Take a look at it and play with
    it a bit. Then in the next post I'll explain the other part of auto
    detection.

    /* PopQuiz.rex */

    data.101 = 0
    data.102 = 0
    data.103 = 1
    data.104 = 0
    data.110 = "New York"

    dlg = .PopQuiz~new(data.)
    if dlg~initCode <> 0 then do
    say "Error creating dialog."
    say " Innit Code:" dlg~initCode
    return 99
    end

    ret = dlg~Execute('ShowTop')

    select
    when ret == 2 then
    dlg~doError()
    when data.110~caselessPos("New York") <> 0 then
    dlg~doError()
    otherwise
    dlg~grade(data.)
    end
    -- End select

    dlg~DeInstall

    return 0

    ::requires 'oodwin32.cls'

    ::class 'PopQuiz' subclass userdialog -
    inherit AdvancedControls MessageExtensions

    ::method init
    forward class (super) continue
    if result <> 0 then return
    ret = self~CreateCenter(210, 125, 'Pop Quiz', , , -
    "Ms Shell Dlg 2", 8)
    if ret == 0 then self~initCode = -1

    ::method defineDialog

    self~addGroupBox(10, 10, 79, 95, "State Location")

    self~addRadioButton(101, "westRB", 18, 26, 61, 10, -
    "The West")
    self~addRadioButton(102, "midWestRB", 18, 46, 61, 10, -
    "The Mid West")
    self~addRadioButton(103, "eastRB", 18, 66, 61, 10, -
    "The East")
    self~addRadioButton(104, "southRB", 18, 88, 61, 10, -
    "The South")

    text = "Enter a new name of a state in the United " || -
    "States and then select the button that " || -
    "matches the state's location. If you " || -
    "cancel, you fail the quiz. If you do not " || -
    "enter a new name, you also fail."

    self~addText(98, 15, 94, 57, text)
    self~AddEntryLine(110, "editData", 100, 81, 92, 14, -
    "AUTOSCROLLH")

    self~AddButton(IDCANCEL, 95, 101, 50, 14, 'Cancel')
    self~AddButton(IDOK, 149, 101, 50, 14, 'Okay', , "DEFAULT")

    ::method doError
    j = errorDialog("Sorry, you failed")

    ::method grade
    use strict arg data.

    select
    when data.101 == 1 then area = "the West"
    when data.102 == 1 then area = "the Mid West"
    when data.103 == 1 then area = "the East"
    when data.104 == 1 then area = "the South"
    otherwise area = "ERROR"
    end
    -- End select
    state = data.110~strip

    msg = "The student says" state "is in" area
    j = infoDialog(msg)

    --
    Mark Miesfeld

  9. Default Re: OOrexx dialog questions

    On Oct 18, 10:31 am, Mark Miesfeld <miesf...@gmail.com> wrote:
    > On Oct 17, 5:54 pm, globaloney <jgol...@excite.com> wrote:
    > >  I have the following questions
    > > ...
    > >  ::method initAutoDetection
    > >    self~noAutoDetection

    >
    > >    how exactly does auto detection work?

    >
    > I lump two things together under auto detection.  Using a dialog data
    > stem to set and get the state of the dialog controls and the creation
    > of an attribute with the same name as the dialog control.


    Okay, this is about the second part of auto detection that I mentioned
    above.

    2.) When auto detection is on, the ooDialog framework creates an
    attribute for your dialog object, for each control, that can be used
    to reflect the state of that control. When you dialog finishes
    executing, ooDialog will automatically update the attribute to reflect
    the state of the control at the time the dialog ended.

    Down below, I attached a complete working program, PopQuiz2, that
    functions exactly the same as the first PopQuiz program. This program
    uses this second part of auto detection.

    There are very few changes between the 2 programs. Here is how this
    works. If you look at defineDialog(), at the statements where the
    different controls are added, you see for instance:

    self~AddEntryLine(110, "editData", 100, 81, 92, 14, -
    "AUTOSCROLLH")

    In the above, the resource ID for the edit control is 110, and the
    name for the control is editData. ooDialog, then creates an attribute
    of the PopQuiz dialog object with the name of editData. You can then
    get the content of the edit control after the dialog finishes
    executing from that atttibute. So you could do something like:

    ret = dlg~Execute('ShowTop')
    say "Text in the edit control is:' dlg~editData

    Another add statement:

    self~addRadioButton(102, "midWestRB", 18, 46, 61, 10, -
    "The Mid West")

    There the resource ID is 102 and the name for the control is
    midWestRB. So you could do something like this after the dialog ends.

    ret = dlg~Execute('ShowTop')
    if dlg~midWestRB == 1 then
    say 'The Mid West button is checked'
    else
    say 'The Mid West button is not checked'

    That is the basics of it.

    The only changes in the second program are:

    when dlg~editData~caselessPos("New York") <> 0 then
    dlg~doError()
    otherwise
    dlg~grade

    and:

    ::method grade

    select
    when self~westRB == 1 then area = "the West"
    when self~midWestRB == 1 then area = "the Mid West"
    when self~eastRB == 1 then area = "the East"
    when self~southRB == 1 then area = "the South"
    otherwise area = "ERROR"
    end
    -- End select
    state = self~editData~strip

    msg = "The student says" state "is in" area
    j = infoDialog(msg)

    Theere I use the dialog object attributes instead of the stem to get
    the state of the dialog controls after the user closes the dialog.

    This is the complete program so you can cut and paste it to run it.

    /* PopQuiz2.rex */

    data.101 = 0
    data.102 = 0
    data.103 = 1
    data.104 = 0
    data.110 = "New York"

    dlg = .PopQuiz~new(data.)
    if dlg~initCode <> 0 then do
    say "Error creating dialog."
    say " Innit Code:" dlg~initCode
    return 99
    end

    ret = dlg~Execute('ShowTop')

    select
    when ret == 2 then
    dlg~doError()
    when dlg~editData~caselessPos("New York") <> 0 then
    dlg~doError()
    otherwise
    dlg~grade
    end
    -- End select

    dlg~DeInstall

    return 0

    ::requires 'oodwin32.cls'

    ::class 'PopQuiz' subclass userdialog -
    inherit AdvancedControls MessageExtensions

    ::method init
    forward class (super) continue
    if result <> 0 then return
    ret = self~CreateCenter(210, 125, 'Pop Quiz', , , -
    "Ms Shell Dlg 2", 8)
    if ret == 0 then self~initCode = -1

    ::method defineDialog

    self~addGroupBox(10, 10, 79, 95, "State Location")

    self~addRadioButton(101, "westRB", 18, 26, 61, 10, -
    "The West")
    self~addRadioButton(102, "midWestRB", 18, 46, 61, 10, -
    "The Mid West")
    self~addRadioButton(103, "eastRB", 18, 66, 61, 10, -
    "The East")
    self~addRadioButton(104, "southRB", 18, 88, 61, 10, -
    "The South")

    text = "Enter a new name of a state in the United " || -
    "States and then select the button that " || -
    "matches the state's location. If you " || -
    "cancel, you fail the quiz. If you do not " || -
    "enter a new name, you also fail."

    self~addText(98, 15, 94, 57, text)
    self~AddEntryLine(110, "editData", 100, 81, 92, 14, -
    "AUTOSCROLLH")

    self~AddButton(IDCANCEL, 95, 101, 50, 14, 'Cancel')
    self~AddButton(IDOK, 149, 101, 50, 14, 'Okay', , "DEFAULT")

    ::method doError
    j = errorDialog("Sorry, you failed")

    ::method grade

    select
    when self~westRB == 1 then area = "the West"
    when self~midWestRB == 1 then area = "the Mid West"
    when self~eastRB == 1 then area = "the East"
    when self~southRB == 1 then area = "the South"
    otherwise area = "ERROR"
    end
    -- End select
    state = self~editData~strip

    msg = "The student says" state "is in" area
    j = infoDialog(msg)

    --
    Mark Miesfeld

  10. Default Re: OOrexx dialog questions

    On Oct 17, 5:54 pm, globaloney <jgol...@excite.com> wrote:

    > I have the following questions


    I'll answer the last couple of questions here.

    > *****************************************************************
    >
    > In the defineDialog method we are using the down variable as a
    > place marker
    > for where the next line would be. How do I capture it if I need to
    > use it in a
    > subsequent method?


    You could either capture it as an exposed variable, or you could add
    an attribute to your class to hold it. Which to use would depend on
    how you expect your program to evolve. (Plus there are other ways of
    course.)

    With the current program, I would just use an exposed variable, like
    so:

    ::method defineDialog
    expose a. down
    ....
    down=30

    Then in some other method you would just do:

    ::method example
    expose down
    say 'The value of down is:' down

    (By the way, I am using ooRexx 3.2.0 for these examples. Some things
    I take for granted are not available in earlier versions.)

    If you needed to make the value of down available outside of the
    dialog object, then adding an attribute makes more sense. I might do
    something like this:

    ::attribute down get
    ::attribute down set private

    Witht the above only your object could change the value, but you could
    have access to it outside your object.

    You could do, maybe:

    MyDialog~Execute('ShowTop')
    say 'Ended up with down:' MyDialog~down

    and internally do:

    ::method defineDialog
    expose a. down

    down = 0
    do i to 10
    down = down + i
    end


    > Also if I create new A. stem variables in another method can I
    > update A.
    > or is that now closed off by the super invocation in the Init method?


    Not sure what you are driving at here. But, it is certainly not
    closed off.

    ::method Init
    expose a.
    forward class (super) continue
    a. = arg(3)

    The exposed variable a. is now set to whatever was passed, if
    anything, as the 3rd argument.

    ::method someThing
    expose a.
    a.newTail = 'Mark'

    ::mehtod otherThing
    expose a.
    a.newTail = 'Tom'

    All of the above would work. If you mean this:

    ::method replace
    expose a.
    a. .stem~new
    a.1 = 10
    a.2 = 20

    Now your original a. stem is gone and replaced by a new stem variable.

    >
    > ********************************************************************
    > And finally If I change or add any numbers to the cells how do I
    > update
    > the row totals, the line totals and the total?
    > Do I copy all the calculation statements from the InitDialog method
    > into the reset method?


    Well, as soon as you start thinking "copy all statements" I would
    suggest you start thinking "put those statements in a separate method"
    and then just invoke the method when you need to. For instance:

    ::method calc
    expose a. zed

    do i = 1 to zed
    lTotal = 0
    do j = 1 to zed
    lTotal += a.i.j
    end
    a.lineTotal.i = lTotal
    end

    a.total = 0
    do j = 1 to zed
    rTotal = 0
    do i = 1 to zed
    rTotal += a.i.j
    end
    a.RowTotal.j = rTotal
    a.total += rTotal
    end

    Once you do that, becomes apparent you need a few other methods like
    setTotals() and getCellValues(). Here is your program reworked so
    that the 'Reset' button works. You can just cut and paste it and it
    should run. Remember though that you need ooRexx 3.2.0.

    /* TableValues.rex */
    arg inp
    if inp='' then inp=9

    /*set up a stem variables*/
    DO i = 1 TO 30
    do j = 1 to 30
    a.i.j = 0
    end
    END

    a.1.1 = 5.88
    a.1.2 = 39.50
    a.1.3 = 49.17
    a.1.9 = 11.22
    a.2.1 = 303.59
    a.2.2 = 0
    a.2.3 = 28.75
    a.3.1 = 1215.66
    a.3.2 = 643.98
    a.3.5 = 32.76
    a.zed=inp

    MyDialog=.MyDlgClass~new( , , a.)
    if MyDialog~initCode == 0 then do
    MyDialog~Execute('ShowTop')
    MyDialog~DeInstall
    end
    else do
    say 'Error initializing'
    say 'Aborting'
    end
    return

    /***************start dialog*******************************/
    ::requires 'oodwin32.cls'

    ::class MyDlgClass subclass userdialog

    ::method Init
    expose a. zed

    forward class (super) continue

    a. = arg(3)
    zed = a.zed

    /*dialog screen*/
    x=(53*zed)+100 ; y=(30*zed)+100
    ret=self~CreateCenter(x,y, -
    'Test form', , ,'MS Sans Serif', 8)
    self~InitCode=(ret=0)

    -- We will set the control values ourselves.
    ::method initAutoDetection
    self~noAutoDetection

    ::method defineDialog
    expose a. zed

    -- Add the year field
    self~AddText(5, 08 ,85 , 8,'Year')
    self~AddEntryLine(21,"d",25,05,20,12,"right")

    down=30
    alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    n=90
    DO k=1 to zed
    tab=10
    down=down+15

    idBase = k * 100

    p=substr(alpha,k,1)
    self~AddText(tab,down+3,20, 8,'Line 'p )

    Do j=1 to zed
    -- Add cell field
    cellId = idBase + j
    tab=tab+40
    self~AddText(tab+9,30 ,25, 8,'Row 'j )
    self~AddEntryLine(cellId, , tab,down,35,12,"right")
    end

    -- Add line total field
    lineTotalId = idBase + 50
    self~AddEntryLine(lineTotalId, ,tab+45,down,35,12,"right")
    end

    self~AddBlackRect(45,42,tab-5,down-25)
    self~AddText(tab+48,30 ,40, 8,'Line totals' )
    tab=10
    down=down+30

    rowTotalIdBase = (zed + 2) * 100
    DO j=1 to zed
    -- Add row total fields
    rowTotalId = rowTotalIdBase + j
    tab=tab+40
    self~AddEntryLine(rowTotalId, ,tab,down,35,12,"right")
    end

    -- Add overall total field
    totalTotalId = 40
    self~AddText(10,down ,40 , 8,'Row Totals')
    tab=tab+45
    self~AddText(tab+8,down-10 ,40 , 8,'TOTAL')
    self~AddEntryLine(totalTotalId, ,tab,down ,35,12, "right")

    -- Add the push buttons
    self~AddButton(1,Self~SizeX-180,Self~SizeY-40, -
    50,15,'OK','Ok','DEFAULT')

    self~AddButton(2,Self~SizeX-120,Self~SizeY-40, -
    50,15,'Cancel','Cancel')

    self~AddButton(3,Self~SizeX-60,Self~SizeY-40, -
    50,15,'Reset', onReset)

    self~ConnectButton(3, "reset")

    ::method InitDialog
    expose a. zed

    -- Set the year field
    self~setEntryLine(21, right(date(),4))

    -- Calculate all the totals
    self~calc

    -- Set all the cell values
    do i = 1 to zed
    idBase = i * 100

    do j = 1 to zed
    self~setEntryLine(idBase + j, a.i.j)
    end
    end

    -- Set all the total fields
    self~setTotals

    ::method onReset
    expose a.

    self~getCellValues
    self~calc
    self~setTotals

    ::method calc
    expose a. zed

    do i = 1 to zed
    lTotal = 0
    do j = 1 to zed
    lTotal += a.i.j
    end
    a.lineTotal.i = lTotal
    end

    a.total = 0
    do j = 1 to zed
    rTotal = 0
    do i = 1 to zed
    rTotal += a.i.j
    end
    a.RowTotal.j = rTotal
    a.total += rTotal
    end

    ::method setTotals
    expose a. zed

    -- Set the line total fields
    do i = 1 to zed
    idBase = i * 100
    lineTotalId = idBase + 50
    self~setEntryLine(lineTotalId, a.lineTotal.i)
    end

    -- Set the row total fields
    rowTotalIdBase = (zed + 2) * 100
    do j=1 to zed
    rowTotalId = rowTotalIdBase + j
    self~setEntryLine(rowTotalId, a.rowTotal.j)
    end

    -- Set the overall total field
    totalTotalId = 40
    self~setEntryLine(totalTotalId, a.Total)

    ::method getCellValues
    expose a. zed

    -- Set all the cell values
    do i = 1 to zed
    idBase = i * 100

    do j = 1 to zed
    a.i.j = self~getEntryLine(idBase + j)
    end
    end


    --
    Mark Miesfeld

+ Reply to Thread
Page 1 of 2 1 2 LastLast