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


  • Subject: RE: Overloading in RPG
  • From: "Bartell, Aaron L. (TC)" <ALBartell@xxxxxxxxxxxxxx>
  • Date: Fri, 11 May 2001 11:49:02 -0500

You totally missed my point Gwecnal.  That was an EXAMPLE.  You can create
whatever overloaded methods that you want.  I did not see this light until I
started programming in Java 4 months ago.  That may be where you want to
start if you don't understand my point.

Aaron Bartell

-----Original Message-----
From: Gwecnal@aol.com [mailto:Gwecnal@aol.com]
Sent: Friday, May 11, 2001 10:19 AM
To: rpg400-l@midrange.com
Subject: RE: Overloading in RPG


In a message dated Thu, 10 May 2001 14:40:44 -0500,  "Bartell, Aaron L.
(TC)" 
<ALBartell@taylorcorp.com> writes:

>  Exactly!  Basically they are entirely different but they all have the
same
>  name.  Maybe the examples given here are bad examples but there is
>  definitely a place for overloading in RPG.  Lets say I want to look up a
>  customer information record. Sometimes I only have the last name of the
>  customer, and sometimes I have the actual customer number, but I could
call
>  #GetCustInfo with either the Last name or the customer number.  i.e.
>  #GetCustInfo(LastName) or #GetCustInfo(CustNo).  Do you see the
advantage?

No.  Here I would definitely want #GetCustInfoNo(CustNo) and 
#GetCustInfoName(LastName) as different functions.  They would use different
access paths, one would just chain and return Yes/No the other would do a 
fuzzy soundex search and return a 'most likely to least likely' subfile to 
select from - TOTALLY different functionality for ENTIRELY different 
application.

I would turn your assertion upside down and say this: 'If you have a
function
that you think it would make sense to overload, you have not done your
functional decomposition right and have misnamed your function.'  

Properly named and designed functions are not tempting targets for 
overloading.
It is only functions called DoWhatIMean(WhatIGiveYou) that lend themselves
to that particular nightmare.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.