Hello,
I started a new bundle for editing COBOL (indeed... ;-) http://pieterb.be/coding/cobol/
Right at the moment I've only some syntax highlighting, but I' did like to know how I can implement auto-numbering. I am only a beginner with these bundles.
Each new line should start with a number of 6 digits, if possible with +10 for each new line. (calculated with the number in 1-6 off the previous line) 000100 000110 ...
Each line ends after 80 columns (or characters) Is it possible to always(!) wrap after 80 chars?
Another issue: commenting; cobol uses a star in column 7 to show a line is comment. For example: 000220*A helloworld example.... 000230
Is this possible. Any help is greatly appreciated...
Pieter Baele pieter.baele@telenet.be
A solid systems's approach should not be based on "but it works". Yet, time and time again, we see that for most people this is the case. They don't care about good software, only about "good enough" software. So the programmers can continue to make such mistakes.
On Jun 18, 2007, at 6:10 AM, Pieter Baele wrote:
Right at the moment I've only some syntax highlighting, but I' did like to know how I can implement auto-numbering. I am only a beginner with these bundles.
What you can do is make a command that uses return as the trigger, find the current lines number with the TM_CURRENT_LINE variable and then insert a newline and the next number.
Now this doesn't take into account inserting something in the middle of some already created lines. For that you'd need a renumber all lines command, should be pretty simple to write.
Each line ends after 80 columns (or characters) Is it possible to always(!) wrap after 80 chars?
Automatically wrap no, in the grammar you could mark any content after 80 as invalid but that's it. Even that wouldn't take hold for items starting before 80 and going after. You can set the wrap column at 80 so you have the visual indicator. And you could also have the return command automatically make any line that's too long two lines. (If you can make it smart enough to know where to split it)
Another issue: commenting; cobol uses a star in column 7 to show a line is comment.
(?<=^\d\d\d\d\d\d)*.*$\n?
Look back to make sure we're at the beginning of a line, then match the line with the optional newline after.