Menu

Pressing [ENTER] for Data Entry

GnuCOBOL
2024-09-02
2024-09-03
  • John Ritter

    John Ritter - 2024-09-02

    Probably a rookie problem as I get used to GnuCOBOL, but I haven't been able to figure this one out as I port beaucoup applications.
    The behavior I'm used to is that if I ACCEPT a field with PIC X or PIC 9 then action is taken. No matter what I attempt, it appears that once you enter a value, you MUST press the [ENTER] (or perhaps [TAB]) to move to the next field.
    I'm trying to streamline a full screen of data entry where if the field is filled it skips [ENTER]. Eliminating 30 odd keystrokes is a big help. Another example would be selecting items from a menu: If I pick "3" then it goes as opposed to "3" then [ENTER] Is this possible?
    Thanks.

     
  • Vincent (Bryan) Coen

    For accept for a field use AUTO
    Enter is not needed for a fixed sized field or similar.
    If the data is preloaded then also add UPDATE but without it all data is fresly created with any existing over written.
    Also see AUTO-SKIP in Prog guide or ref, sections 6.9.3 through 6.9.5

     
  • Simon Sobisch

    Simon Sobisch - 2024-09-03

    What was the original COBOL environment that has the implicit AUTO accept (=if field is full, then skip to the next field like "TAB" would, if single-fields or on last one handle as "ENTER")?

    What is your current compile command?

     
  • John Ritter

    John Ritter - 2024-09-03

    Thanks! I saw "AUTO" (6.9.3) where it says it applies to SCREEN and completely missed it under ACCEPT (7.8.1.4)

     
    • Simon Sobisch

      Simon Sobisch - 2024-09-03

      Was that RM/COBOL? If yes then -std=rm/-std=rm-strict should get you that without explicit coding it, otherwise -faccept-auto should.

       

Log in to post a comment.