Code Comments
Programming Forum and web based access to our favorite programming groups.While playing around with the COBOL12 compiler (discussed elsewhere recently in this newsgroup), I ran into a few peculiarities. This is a DOS compiler that looks like a subset of 74 standard COBOL but has some extensions and some omissions. Its display is unusual since it uses a graphics mode to display text. Anyway I noticed two strange things. The compiler does not accept blank lines in source code and it requires a variable name to be separated by at least one space from the parentheses enclosing a subscript (or an expression denoting reference modification). An old CP/M era compiler also had this requirement for subscripts (of course there was no reference modification). 1. Was this ever part of a COBOL standard? 2. I sometimes find it puzzling that spaces seem to be required around certain things in COBOL when I don't expect them to be. For example after commas (in CALL), around the colon in reference modification (at least in the compilers I've tested) and around operators in a COMPUTE expression. Please note that the first language I learned was FORTRAN using fixed-form (punched card) format. There spaces are only meaningful inside string literals. Is there a general rule about this for COBOL and has it changed with different versions of the standard? (Sorry if this is a FAQ.)
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.