Code Comments
Programming Forum and web based access to our favorite programming groups.sorry. my english is very poor. so my text is not proof reading -_-a If SOURCEFORMAT was FREE, Copy text was Fixed? example: $ SET SOURCEFORMAT "FREE" IDENTIFICATION DIVISION. PROGRAM-ID. Aroma96exam. *STUDENT NAME ................................................. *STUDENT ID ..................................................... ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. DATA DIVISION. COPY "abc.txt". ............. abc.txt was fixed or free? 01 dat1 pic x(10). <-? 01 data pic x(10) <-?
Post Follow-up to this messageapknight wrote: > sorry. my english is very poor. so my text is not proof reading -_-a > > > If SOURCEFORMAT was FREE, Copy text was Fixed? > > > example: > > > $ SET SOURCEFORMAT "FREE" > > IDENTIFICATION DIVISION. > > PROGRAM-ID. Aroma96exam. I'm not sure what compiler you're using, but the one I have (Fujitsu) has settings for "Source Format" for both the program, and the copy texts. Check the compiler's manual and see if SOURCEFORMAT can take two arguments. :) -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~ / \ / ~ Live from Montgomery, AL! ~ ~ / \/ o ~ ~ ~ / /\ - | ~ daniel@thebelowdomain ~ ~ _____ / \ | ~ http://www.djs-consulting.com ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~ ~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~ ~ h---- r+++ z++++ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
Post Follow-up to this messageLX-i <lxi0007@netscape.net> wrote in news:afdb7$422c4e68$45491f85$25530 @KNOLOGY.NET: > apknight wrote: > > I'm not sure what compiler you're using, but the one I have (Fujitsu) > has settings for "Source Format" for both the program, and the copy > texts. Check the compiler's manual and see if SOURCEFORMAT can take two > arguments. :) > > Another option would be use a format in cpy files that works with both free and normal. Eg, columns 01-06 are blank (only), never go past column 72, comments are marked by an "*" in column 07, and a ">" in column 08. You are not allowed to put "-" in column 07 (or anything else but spaces as well). Start paragraph names in column 08, all else in column 12. Have I missed anything? This should work whether or not you are in "free" mode or not.
Post Follow-up to this messageapknight wrote: > sorry. my english is very poor. so my text is not proof reading -_-a > > > If SOURCEFORMAT was FREE, Copy text was Fixed? > > > example: > > > $ SET SOURCEFORMAT "FREE" > > IDENTIFICATION DIVISION. > > PROGRAM-ID. Aroma96exam. > > > > *STUDENT NAME ................................................. > > *STUDENT ID ..................................................... > > > > ENVIRONMENT DIVISION. > > INPUT-OUTPUT SECTION. > > FILE-CONTROL. > > > > DATA DIVISION. > > COPY "abc.txt". > > ............. > > > > abc.txt was fixed or free? > > > > 01 dat1 pic x(10). <-? > > > > 01 data pic x(10) <-? I assume you are using a Micro Focus compiler. I think, (but could be wrong), that they are the only ones who use $set to indicate Directives. Whether or not you use fixed or free format I think is just a personal preference. I prefer fixed giving me a margin around my text, which I find more 'pleasing' - and using 'portrait' (8.5 x 11), there is room to use a three-hole punch so that you can put source into a binder. (Not that I do that - but the facility is there). Back through the 60's-80's on mainframes with print barrels that gave only Uppercase then free format would have been useful. The 80 column maximum meant that printing on continuous 11 x 14 there was a fair amount of paper wastage on the right side of each sheet. You can (assuming Micro Focus again), use free format with a maximum line of 250 characters. Now try and print it out - you would have to select 'landscape' and chances are you will finish up with a fair amount of wastage on the right, yet again. Never tried it - but do you have to put that very first $set sourceformat "free", starting in Column 7. Presumably all subsequent lines can be coded to the extreme left starting at Column 1. Again no knowledge of it, but I would have thought copy 'abc.txt' also starts in Column 1 - although if using free format, aren't the rules relaxed about column positioning, with a compiler ignoring preceding spaces in any one line ???? The real practical use I have seen for free format is reducing the amount of space taken up in a text book, where the author has the source as a table of two columns. (Yes of course using laser printers you can even get more than one page of source on a sheet - so one sheet of paper can, front and back contain four lots of source. Trouble with that, unless your eyesight is very good - you can't read it easily). A possible tip if you are using Net Express. There are many occasions where utilties, copyfiles can be used with more than one applicaion. My approach I put the 'originals' in an application 'copylib' - within individual projects I will then have say DateRoutines.cbl - within the current project there is a three-liner :- *>------------ DateRoutines.cbl-------------- copy "\coplylib\DateRoutines.cbl". *>-------------------------------------------- I have to compile the above within the current project - but it is at least referencing the original source which can also be used by other applicatons. If I have applications using common copyfiles, then you will see an entry in the appropriate source :- copy "\copylib\dates2.cpy". One immediate reaction from others here might be, the approach is half-assed - produce a copylib DLL - but I don't necessarily want a DLL covering ALL that is in the copylib - the current application may only use 10% of the \copylib. Jimmy
Post Follow-up to this messageActually, you don't need to put the "*" in column 7 and the ">" in column 8. If you start a line with "*>" anywhere after column 6, it will work. You don't talk about the "/" for page eject - but I don't see that in very common usage anymore. The '02 Standard allows fixed and free format to have a statement. You also don't talk about debugging lines. In the '02 Standard, both fixed a nd free format support -- Bill Klein wmklein <at> ix.netcom.com "Russell" <rws0203nospam@comcast.net> wrote in message news:Xns96127CE1F176Arws0203comcastnet@2 16.196.97.131... > LX-i <lxi0007@netscape.net> wrote in news:afdb7$422c4e68$45491f85$25530 > @KNOLOGY.NET: > > two > > Another option would be use a format in cpy files that works > with both free and normal. Eg, columns 01-06 are blank (only), never go > past column 72, comments are marked by an "*" in column 07, and a ">" in > column 08. You are not allowed to put "-" in column 07 (or anything else > but spaces as well). > > Start paragraph names in column 08, all else in column 12. > > Have I missed anything? > > This should work whether or not you are in "free" mode or not.
Post Follow-up to this message> 1) Actually, you don't need to put the "*" in column 7 and the ">" in column 8. > 2) If you start a line with "*>" anywhere after column 6, it will work. 2) is compiler dependent. 1) should work with _any_ compiler, even '74.
Post Follow-up to this messageI don't know how widespread the "*>" comment is. A "*>" in col 7 would work on any compiler. However, since we are talking about compilers that support freeform, I suppose that the distinction is pointless. I have no idea what to do about "/" and "D", other than do not use. "William M. Klein" <wmklein@nospam.netcom.com> wrote in news:IP1Xd.4391408$f47.787549@news.easynews.com: > Actually, you don't need to put the "*" in column 7 and the ">" in > column 8. > > If you start a line with "*>" anywhere after column 6, it will work. > > You don't talk about the "/" for page eject - but I don't see that in > very common usage anymore. The '02 Standard allows fixed and free > format to have a > statement. > > You also don't talk about debugging lines. In the '02 Standard, both > fixed and free format support > > LX-i <lxi0007@netscape.net> wrote in news:afdb7$422c4e68$45491f85$25530 > @KNOLOGY.NET: > > two > > Another option would be use a format in cpy files that works > with both free and normal. Eg, columns 01-06 are blank (only), never go > past column 72, comments are marked by an "*" in column 07, and a ">" in > column 08. You are not allowed to put "-" in column 07 (or anything else > but spaces as well). > > Start paragraph names in column 08, all else in column 12. > > Have I missed anything? > > This should work whether or not you are in "free" mode or not.
Post Follow-up to this messageWilliam M. Klein wrote: > Actually, you don't need to put the "*" in column 7 and the ">" in column 8.[/colo r] You do if you want it to work with fixed format as well... :) -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~ / \ / ~ Live from Montgomery, AL! ~ ~ / \/ o ~ ~ ~ / /\ - | ~ daniel@thebelowdomain ~ ~ _____ / \ | ~ http://www.djs-consulting.com ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~ ~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~ ~ h---- r+++ z++++ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
Post Follow-up to this messageYou don't if you have a compiler with the '02 Standard's fixed form referenc e format. If your compiler accepts *> as an inline indicator - then it (probably) acce pts it in any format. A line like: *> This is a comment will be treated as a comment no matter where the "*" is. If you have a compiler that doesn't accept "*>" as inline comment indicator for fixed format, then I doubt that it accepts it for free format either. -- Bill Klein wmklein <at> ix.netcom.com "LX-i" <lxi0007@netscape.net> wrote in message news:4642e$422cc399$45491f85$7817@KNOLOG Y.NET... > William M. Klein wrote: > > You do if you want it to work with fixed format as well... :) > > > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ > ~ / \ / ~ Live from Montgomery, AL! ~ > ~ / \/ o ~ ~ > ~ / /\ - | ~ daniel@thebelowdomain ~ > ~ _____ / \ | ~ http://www.djs-consulting.com ~ > ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ > ~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~ > ~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~ > ~ h---- r+++ z++++ ~ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
Post Follow-up to this message"LX-i" <lxi0007@netscape.net> wrote in message news:4642e$422cc399$45491f85$7817@KNOLOG Y.NET... > William M. Klein wrote: column 8. > > You do if you want it to work with fixed format as well... :) Well, I think Bill already established that the context was one in which the *compiler* would support either one. In that environment, I think it's probable that any implementation would have allowed "*>" as a floating indicator anywhere (including after nonblank data in the line) in both fixed-form and free-form reference formats according to the 2002 standard. The Unisys MCP COBOL85 implementation, in an extension to (its) COBOL standard, certainly allows "*>" as a floating comment indicator, and I seriously doubt that that compiler's unique among ANSI-85 implementations in doing so. -Chuck Stevens
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.