Skip to main content

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
we have the same problem.

We want to catch some data from a grid in a called program.

When we look at the debugger the programm pass all routines...
and at "goback" the acu-runtime is closed - but he should goback to the calling program :(

We also tested it with "exit program" but the same effect.

We tested it with a list-box - if the same problem occurs - but this works.

Regards
David Neidinger

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
Originally posted by vinsnash
The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?


If I understand you correctly, you are destroying the window and the app from within the event procedure, is that so? This would then explain the peculiar behavior. Try terminate the accept statement and then run the exit procedure as usual and it should work.

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
Originally posted by vinsnash
The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?


If I understand you correctly, you are destroying the window and the app from within the event procedure, is that so? This would then explain the peculiar behavior. Try terminate the accept statement and then run the exit procedure as usual and it should work.

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
is it possible to get an example program?



.
.
.
           03  e-grid, grid, col 2, line 4, lines 10, size 120,
               column-headings, no-box, id is 2
               heading-font     default-font,
               heading-color    304,
               font             small-font,
               insert-rows      11,
               data-columns     (  1,  2,  3, 23, 33 )
               display-columns  (  1,  5,  9, 35, 50 )
               separation       ( 10, 10, 10, 10, 10 )
               alignment        ( "C", "C", "L", "L", "L" )
               data-types ( "x", "x", "x(20)", "x(10)", "x(50)" )
               event procedure is grid-handle.
.
.
.
.
       main-routine.
           perform until exit-button-pushed
               move    4 to accept-control
               accept  sub-screen
                       on exception     perform on-exception
                       not on exception perform no-exception
               end-accept
           end-perform

           perform exit-programm.
.
.
.
       grid-handle section.
           evaluate event-type
              when msg-begin-entry
                   display message box "catch event - leave subprogram"
                   move event-action-terminate to event-action
                   set  exit-button-pushed to true                   
              when other
                   move event-action-fail to event-action
           end-evaluate.

       grid-handle-ende.
           exit.
       grid-handle-e.
.
.
.


i never come back to the main-routine after the event. On any action in the grid - only the "grid-handle section" is performed nothing other. So we tried to leave the program with that code:


       grid-handle section.
           evaluate event-type
              when msg-begin-entry
                   display message box "catch event - leave subprogram"
                   move event-action-terminate to event-action
                   destroy sub-screen
                   destroy panel-screen
                   destroy sub-window
                   goback
              when other
                   move event-action-fail to event-action
           end-evaluate.

       grid-handle-ende.
           exit.
       grid-handle-e.


and then the runtime get terminated at goback.

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
We use the following code to pick up the value of the 1st cell and close the program, when the user press enter or double-click on a row.


Form1-Gd-1-Ev-Msg-Begin-Entry.
INQUIRE Form1-Gd-1, ENTRY-REASON IN GRID-REASON
MOVE EVENT-ACTION-FAIL-TERMINATE TO EVENT-ACTION
IF GRID-REASON = X"0D" OR X"00"
MODIFY Form1-Gd-1, X 1
INQUIRE Form1-Gd-1, CELL-DATA IN CODE-LNK
SET END-PROGRAM TO TRUE
END-IF
.

Form1-Gd-1-Bef-Procedure.
IF END-PROGRAM
MOVE 3 TO ACCEPT-CONTROL
MOVE 27 TO CONTROL-VALUE
END-IF
.

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
vinsnash and frosti, the test.zip contains the sample programs.

Regards
Adam

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
vinsnash and frosti, the test.zip contains the sample programs.

Regards
Adam

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
Thank you BMS,

I never would have thought of that technique.


Regards

Vins Nash

[Migrated content. Thread originally posted on 02 March 2005]

I have a grid control with row and column headings. This program is called as a look up from another program with the intent of passing data selected back to the calling program. Using the Msg-Heading-Clicked event I determine, using event-data-2. that a row heading has been clicked. I use the row number in event-data-2 and a constant column number to inquire from CELL-DATA the data to pass back and want to exit the called program at that point by performing the standard bench generated exit routine:

Acu-Exit-Rtn.
PERFORM After-Program
EXIT PROGRAM
STOP RUN

?After-Program? closes the files and destroys the screen. However, the runtime ignores the ?EXIT PROGRAM? statement and executes the ?STOP RUN? statement which, of course, shuts down the runtime.

The question is how can I achieve an ?EXIT PROGRAM? after having clicked a row header without having to click some other button?

This is an attempted work around of the fact that grid controls to not have a CMD-DBLCLICK type exception like a list box control. We do not want to modify any generated code files i.e ".evt" and ".prd" outside of the event editor.

Regards

Vins Nash
thx for the example - i see my mistake :)


           evaluate event-type
              when msg-begin-entry
                   display message box "catch event - leave subprogram"
                   move event-action-terminate to event-action
                   set  exit-button-pushed to true                   
              when other
                   move event-action-fail to event-action
           end-evaluate.

       grid-handle-ende.
           exit.
       grid-handle-e.


i used "Event-action-terminate" and not "event-action-fail-terminate"

2nd mistake - i set exit-button-pushed to true - this was overwritten from event-occured...

regards
David Neidinger