Git Product home page Git Product logo

Comments (7)

bmorris1 avatar bmorris1 commented on September 13, 2024 1

Would those rules always give a warning about ON-EXIT not being indented? If so, I think there should be an option about ON-EXIT.

Me, I think ON-EXIT should be at the same indentation level as DCL-PROC and END-PROC,

from vscode-rpgle.

worksofliam avatar worksofliam commented on September 13, 2024

@JamesBrianHill

Feel free to do either of these:

  • a PR to add this line. Though a new PR will also require you to make a test case for this too.
  • Please share a code snippet that used ON-EXIT and I can do the change and create a valid test.

Thanks!
Liam

from vscode-rpgle.

JamesBrianHill avatar JamesBrianHill commented on September 13, 2024

Code snippet:

//--------------------------------------------------------------------------------------------------
// Append a single quote. This procedure exists to make other code more readable.
//--------------------------------------------------------------------------------------------------
DCL-PROC Q;
  DCL-PI Q VARCHAR(2048);
    in_str VARCHAR(2048) CONST OPTIONS(*TRIM);
  END-PI;

  DCL-C C_QUOTE '''';
  DCL-S is_abend IND INZ(*OFF);
  DCL-S return_str LIKE(in_str);

  return_str = %TRIM(C_QUOTE + in_str + C_QUOTE);
  RETURN return_str;

  ON-EXIT is_abend;
    IF is_abend;
      return_str = 'Liam does great work!';
    ENDIF;
END-PROC Q;

from vscode-rpgle.

worksofliam avatar worksofliam commented on September 13, 2024

Looking good. Will be out in an upcoming release.

from vscode-rpgle.

worksofliam avatar worksofliam commented on September 13, 2024

image

from vscode-rpgle.

bmorris1 avatar bmorris1 commented on September 13, 2024

But for sure, code following ON-EXIT should be indented one level higher than ON-EXIT.

from vscode-rpgle.

worksofliam avatar worksofliam commented on September 13, 2024

@bmorris1 Maybe so. I actually like the way @JamesBrianHill provided it because it is part of that procedure and my brain easily associates it when the indentation is higher than the end-proc.

from vscode-rpgle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.