User defined language: Restrict line length

  • Maybe that’s a wish from the good old times, but …

    I’m working with some scientific software that needs its input files as plaintext files - a classic case for np++. I’ve taken a look at defining a user defined language for the input file syntax, but ran into a nasty thing:

    That software has its origins in the ninteen-fifties, when FORTRAN was the real hot stuff (and a real relief from coding in machine code …). Therefore the input line length is restricted to 80 characters (the maximum capacity of a common punch card at that time :). Since transgressing that limit is a common mistake in these input files, which usually causes cryptic error messages (never ever reading “line loo long” …), I’d like to include that restriction into the language definition.

    I can’t find an option for that … any hint ?

    If there no option for that now, I herewith declare that as a feature wish !


  • @Frank-Helk

    While you can’t restrict line-length, you can set something up to get a visual indication for problem lines; an example setup:


    Produces a look like this:


    which clearly identifies long lines in cyan color. The color can of course be changed to whatever you like.

    If you’d like something that will explicitly inform you of long lines, I can assist you in writing a script to do so. Post back if you’d like to try this approach. Here’s an existing script that might help:

Log in to reply