Invalid indicator at column 7

Asked by john grillot

I new to opencobol ide. When I open a sample program it puts most the code starting in column 1. It does the same thing when I paste. Also it's frustrating because if I select a line or many lines and hit tab it doesn't indent the line or block. why doesn't it put the code in the right columns?

Question information

Language:
English Edit question
Status:
Solved
For:
OpenCobolIDE Edit question
Assignee:
No assignee Edit question
Solved by:
ColinDuquesnoy
Solved:
Last query:
Last reply:
Revision history for this message
ColinDuquesnoy (colin-duquesnoy) said :
#1

What version of OpenCobolIDE are you using? Are you using free format or fixed format? (check the Compiler preferences) From what source are you trying to copy/paste? An example would help.

Revision history for this message
john grillot (john-grillot) said :
#2

Version 4.7.6 Below is the source I'm pasteing. You helped me. I added the -free compiler flag and it complied.
Can you explain why I can't use the tab key to indent a line or block of code?

IDENTIFICATION DIVISION.
PROGRAM-ID. CobolGreeting.
*>Program to display COBOL greetings
DATA DIVISION.
WORKING-STORAGE SECTION.
01 IterNum PIC 9 VALUE 5.

PROCEDURE DIVISION.
BeginProgram.
   PERFORM DisplayGreeting IterNum TIMES.
   STOP RUN.

DisplayGreeting.
   DISPLAY "Greetings from COBOL".

Revision history for this message
Best ColinDuquesnoy (colin-duquesnoy) said :
#3

I guess you added -free to the Extra Compiler Flags but OpenCobolIDE do not read extra compiler flags, instead you should check the Free format checkbox. If this checkbox is checked, OpenCobolIDE will understand that you want to work in free format, the red margin lines will disappear and you'll be able to indent your code freely.

In fixed format mode, the editor indents the selected lines at column 7, the 6 first characters are never indented (this is the normal behaviour because the 6 first characters are not COBOL code, indenting them would cause compiler errors. Those 6 first characters usually contains a revision date).

Revision history for this message
john grillot (john-grillot) said :
#4

yes you're correct. I unchecked the fixed format checkbox. I set the indentation width to 7 and was able to indent a line or block. I understan if I was writing this code from scratch this wouldn't be necessay but I'm working with existing sample code that doesn't have anything in columns 1-6. This makes it much easier to reformat this code thank you !

Revision history for this message
john grillot (john-grillot) said :
#5

Thanks ColinDuquesnoy, that solved my question.