× 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.



Hi all,

I am often finding that I am declaring a local variable just so I can call another procedure. In that case, the called procedure wouldn't use the variable. I see other programmers who don't declare the variable but just pass 0 or ' ' or *BLANK, etc.

Example

D client_type S LIKE ( REF_client_type )

client_number = 1;
MyProc (
client_number :
client_type );


Instead of :

client_number = 1;
MyProc (
client_number :
' ' );

I don't like this method as I often see this kind of thing :

MyProc (
client_number :
' ' :
0 :
client_info :
more_client_info :
' ' :
);

Here one can only presume that the parameters with ' ' or 0 aren't used. In my first example, I can see that client_type isn't initialised so isn't being used, although it probably still needs a comment. Also when I declare the local variable, I use the same reference field that is used in the prototype.
D MyProc PR
D client_number S LIKE ( REF_client_number )
D client_type S LIKE ( REF_client_type )



I just wondered if this is what *OMIT is for?

MyProc (
client_number :
*OMIT :
*OMIT:
client_info :
more_client_info :
*OMIT :
);

Thanks.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.