ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Help with a Subfile Windowing Pgm

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with a Subfile Windowing Pgm

    I have a subfile windowing program that is written for both 80 and 132 column mode (not sure if that matters). It is very simple and displays a short list of payment options for a customer. This is almost always used in 132 column mode (which i used for testing).

    When an error condition occurs, I display the error in the header portion of the window display, subfile records are cleared (in loadsfl). The user can then press F3, F12 or enter. In the program, it simply clears the parameter fields passed in and does a "return" to the calling pgm.

    Here is the strange part. After the return (when the program has ended according to debug), the interactive session actually displays the window (in 80 column mode) WITH the subfile records previously cleared.

    I cannot figure out how or why it's doing this. Here is a code snippet:

    Code:
    [SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]dou[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'a'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'b'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]exsr[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] loadsfl[/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]// Load Subfile[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]write[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] selcard[/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]write[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] selcardf[/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]exfmt[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] selcard[/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] *inkc [/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#808000][SIZE=2][COLOR=#808000]*on[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] or[/SIZE]
    
    [SIZE=2]*inkl [/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#808000][SIZE=2][COLOR=#808000]*on[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] or[/SIZE]
    
    [SIZE=2]@error [/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]<>[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#808000][SIZE=2][COLOR=#808000]*blanks[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2]pent# [/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] *all'0'[/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]clear[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] plst4[/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]clear[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] pexpd[/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080];[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]return;[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]endif;[/COLOR][/SIZE][/COLOR][/SIZE]
    
    ... more code here
    
    [SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]endif;[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]enddo;[/COLOR][/SIZE][/COLOR][/SIZE]
    
    [SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]return;[/COLOR][/SIZE][/COLOR][/SIZE]
    Any ideas what may cause this behavior?

  • #2
    Without seeing the display file source, I don't know the exact cause of the problem, but it sounds like the display file of the program calling the window program needs restore display set to *YES - CHGDSPF FILE(filename) RSTDSP(*YES).

    Comment


    • #3
      Originally posted by Brian Rusch View Post
      Without seeing the display file source, I don't know the exact cause of the problem, but it sounds like the display file of the program calling the window program needs restore display set to *YES - CHGDSPF FILE(filename) RSTDSP(*YES).
      I am fairly certain that it already is. I recall having an issue when we first implemented. If I do CHGDSPF file(filename) and prompt, it shows *YES. Not sure if that's pulling the current settings or not.

      Comment


      • #4
        Found it. The calling program (our ERP) is calling the same SR in two different places... the second time it's setting the screen size to 80.
        Last edited by gwilburn; March 23, 2017, 01:00 PM.

        Comment


        • #5
          Not related but FWIW, I prefer to code DoU ( %SHTDN ) cause I think it looks nicer than DOU ( 'a' = 'b' ). *crawling back under my rock*

          Ringer

          Comment


          • #6
            Originally posted by CRinger400 View Post
            Not related but FWIW, I prefer to code DoU ( %SHTDN ) cause I think it looks nicer than DOU ( 'a' = 'b' ). *crawling back under my rock*

            Ringer
            Ha ha!

            Comment

            Working...
            X