× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Joel,
I like that style. I've used it but sparingly though because noone else
does. I don't believe we even have a standard, probably because noone
realises you can code without the parameters . Using the prompter at least
makes sure everyone writes the same. But you'd certainly be hard pushed to
find a When statement. Lots of goto's though:-)



2012/5/29 Stone, Joel <Joel.Stone@xxxxxxxxxx>

When you create CL code, do you try to make it easy to read ie use lower
case; add some white space, skip keywords such as COND and VAR and THEN,
and line things up?

Like this:

select
when (&reportID = 'LS') goto report_LS
when (&reportID = 'SR') goto report_SR
when (&reportID = 'SB') goto report_SB
otherwise goto endpgm
endselect

report_LS:
chgvar &TITLE1 'New Customer Report'
chgvar &TITLE2 'Trader Notification'
chgvar &SHOWCUST 'N'
chgvar &QRYSLT (&QRYSLT *bcat ' ASHPSTS = +
"UT" *and ASLSCNT = 0 *and ACTMDTR = "R"')


******************************************************
Or
******************************************************

Do you run everything thru the prompter, like this:

select
WHEN COND(&REPORTID = 'LS') THEN(GOTO +
CMDLBL(REPORT_LS))
WHEN COND(&REPORTID = 'SR') THEN(GOTO +
CMDLBL(REPORT_SR))
WHEN COND(&REPORTID = 'SB') THEN(GOTO +
CMDLBL(REPORT_SB))
OTHERWISE CMD(GOTO CMDLBL(ENDPGM))
ENDSELECT

report_LS:
CHGVAR VAR(&TITLE1) VALUE('Loaded Cars Available +
for Sale')
CHGVAR VAR(&TITLE2) VALUE('Trader Notification')
CHGVAR VAR(&SHOWCUST) VALUE('N')
CHGVAR VAR(&QRYSLT) VALUE(&QRYSLT *BCAT ' ASHPSTS = +
"UT" *and ASLSCNT = 0 *and ACTMDTR = "R"')


Which method is preferred or more widely used?

I always do the former (mixed case, skip keywords).
A co-worker goes thru my code and prompts it all into the harder-to-read
(imo) ALL CAPS stuff.

Is this following IT etiquette?

I realize people alter other's code over the years. But this is happening
prior to initial promotion.

Does such an etiquette concept exist in the IT development field?




______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs
Skyscan service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.