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



Scott,

I happen to be working on some changes to the standards at my current shop.

I was leaning toward the following: g prefix for globals, w prefix for local
and p prefix for parameters.

But I really like your idea of using my to prefix locals and I think wk for
globals would be fine.

However, I'm wondering about prefixes for parameters.  I feel a need to set
them apart from the regular variables.   But I never really like the idea of
using a p prefix since that's so often used for "pointer".  Also, it would
seem that I'd want to differentiate between local and global parameters.

I'd like to hear your thoughts on the matter, along with anybody else
wanting to jump in.

Thanks,
Charles


> -----Original Message-----
> From: Scott Klement [mailto:rpg400-l@xxxxxxxxxxxxxxxx]
> Sent: Monday, August 23, 2004 7:11 PM
> To: RPG programming on the AS400 / iSeries
> Subject: RE: Subroutines vs Subprocedures was RE: Indicators
> That's a bad idea, it leads to very confusing code.  I suggest using a
> naming convention where local variables have different names 
> from global
> variables.
> 
> For example, in my shop, global "work" variables (those that 
> aren't coming
> from files) start with the 2-char prefix "wk".  So, if I have 
> a customer
> number that's a global variable, it'll be called wkCust.   Local
> work variables start with the prefix "ww"... a customer number field
> that's local to a subprocedure would be called wwCust. That 
> way there's
> never confusion.
> 
> Though, if I could start over again, I think I'd use "my" for 
> the prefix
> for local variables.  I'm not even sure where I came up with "ww."
> 

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.