Menu

How to DISPLAY/ACCEPT at prior screen LINE/COL

Anonymous
2023-01-31
2023-02-12
  • Anonymous

    Anonymous - 2023-01-31
            MOVE 76543.21 TO NUMBER-PACKED-SIGNED.
            IF NUMBER-PACKED-NOSIGN IS NUMERIC
                MOVE 'Y' TO NUMERIC-SWITCH
              ELSE MOVE 'N' TO NUMERIC-SWITCH.
            DISPLAY 'UNSIGNED PACKED 76543.21 - IS NUMERIC RESULT='
                LINE 9 COL 1 WITH LOWLIGHT
                NUMERIC-SWITCH WITH HIGHLIGHT.
    

    Above is a part of a COBOL test suite I wrote. I am using it to
    learn about gnucobol which I recently installed. The test runs as
    expected. An unsigned packed field properly tests as non-numeric.

    However NUMERIC-SWITCH is not highlighted in this case. As an
    alternative if I make a separate DISPLAY NUMERIC-SWITCH ...
    statement the 'N' displays highlighted at LINE 1 COL 1.

    I do not want to count positions and there are several situations
    where I want a subsequent DISPLAY or ACCEPT to start at the next
    screen position. Previous COBOLs have allowed this by default or by
    specifying "COL 0". I tried this and other methods. I find no help
    in the 700+ page manual. Please advise.
    --
    Sent from my old Linux PC - no advertisement or legal disclaimer.

     
    • Simon Sobisch

      Simon Sobisch - 2023-02-03

      please add the output of cobcrun -V | grep libcob; cobcrun --verbose --info | grep -C1 screen as the used screenio and versions have quite an effect and therefore this information would be good to have ...

       
    • Vincent (Bryan) Coen

      From the manual (PG or PR) - - -

      1. Only data items whose USAGE (see [USAGE], page 217) is either
        explicitly or implicitly
            defined as DISPLAY may be used in NUMERIC or any of the ALPHABETIC
        class conditions.

      2. Some COBOL implementations disallow the use of group items or PIC A
        items with NUMERIC
            class conditions and the use of PIC 9 items with ALPHABETIC class
        conditions. GnuCOBOL
            has no such restrictions.

      On 03/02/2023 12:10, noreply@sourceforge.net wrote:

      |MOVE76543.21TONUMBER-PACKED-SIGNED. IFNUMBER-PACKED-NOSIGNISNUMERIC
      MOVE'Y'TONUMERIC-SWITCH ELSEMOVE'N'TONUMERIC-SWITCH. DISPLAY'UNSIGNED
      PACKED 76543.21 - IS NUMERIC RESULT=' LINE9COL1WITHLOWLIGHT
      NUMERIC-SWITCHWITHHIGHLIGHT. |

      Above is a part of a COBOL test suite I wrote. I am using it to
      learn about gnucobol which I recently installed. The test runs as
      expected. An unsigned packed field properly tests as non-numeric.

      However NUMERIC-SWITCH is not highlighted in this case. As an
      alternative if I make a separate DISPLAY NUMERIC-SWITCH ...
      statement the 'N' displays highlighted at LINE 1 COL 1.

      I do not want to count positions and there are several situations
      where I want a subsequent DISPLAY or ACCEPT to start at the next
      screen position. Previous COBOLs have allowed this by default or by
      specifying "COL 0". I tried this and other methods. I find no help
      in the 700+ page manual. Please advise.

       
    • Anonymous

      Anonymous - 2023-02-12

      I am Burke@bsacompany.com, the anonymous writer of the initial question. I have found that line-col-zero-default "yes" in rm-strict.conf provides the proper default I hoped for.

       
      • Simon Sobisch

        Simon Sobisch - 2023-02-12

        I suggest to register/login when posting :-)

         
      • Simon Sobisch

        Simon Sobisch - 2023-02-12

        Thank you for letting us know the solution to the initial problem!

         

Anonymous
Anonymous

Add attachments
Cancel