Weird error using DISPLAY
Posted: Wed Jun 30, 2021 12:30 am
Hello!
I am struggling with some bizarre errors when using DISPLAY particularly if I try this:
DISPLAY "SHOW FIELD ON SCREEN? (Y/N) (X = EXIT): " WITH NO ADVANCING.
The OpenCOBOL Compiler produces weird errors:
./SchemaCreator.cobc:75: error: 'X' cannot be used here
./SchemaCreator.cobc:75: error: 'Y' cannot be used here
./SchemaCreator.cobc:75: error: syntax error, unexpected NO
./SchemaCreator.cobc:75: error: invalid symbol '!' - skipping word
invalid symbol ! - there isn't a "!" in the DISPLAY statement..?.
Before this there are lots of these type of DISPLAY commands:
DISPLAY " (X = EXIT): " WITH NO ADVANCING.
Which produces no errors! I thought (perhaps assumed?) that COBOL's DISPLAY command was similar to BASIC's PRINT and didn't have the "foibles" of C#/C++...
Any ideas why it doesn't like my DISPLAY statement?
I am struggling with some bizarre errors when using DISPLAY particularly if I try this:
DISPLAY "SHOW FIELD ON SCREEN? (Y/N) (X = EXIT): " WITH NO ADVANCING.
The OpenCOBOL Compiler produces weird errors:
./SchemaCreator.cobc:75: error: 'X' cannot be used here
./SchemaCreator.cobc:75: error: 'Y' cannot be used here
./SchemaCreator.cobc:75: error: syntax error, unexpected NO
./SchemaCreator.cobc:75: error: invalid symbol '!' - skipping word
invalid symbol ! - there isn't a "!" in the DISPLAY statement..?.
Before this there are lots of these type of DISPLAY commands:
DISPLAY " (X = EXIT): " WITH NO ADVANCING.
Which produces no errors! I thought (perhaps assumed?) that COBOL's DISPLAY command was similar to BASIC's PRINT and didn't have the "foibles" of C#/C++...
Any ideas why it doesn't like my DISPLAY statement?