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



In building an API on the i5 with RPGIV which is intended to be callable
from native and web applications I have come across a possible problem that
I have not encountered before. 
 
The API is used to select from a list of addresses, for a customer location,
from a USPS City/State/Zip table and a USPS Street address table, scored by
how well the address matches the user provided information. Depending on the
user provided information the city state zip lookup may result in more than
1 match, e.g.. If the user only provides the city and state and that city
has more than one zip code the API needs to return the list (data
structure/object) to the caller which will display the list to the user who
will select the appropriate zip code and call the API again with the
additional information (zip code). The API will then find a single match in
the USPS City/State/Zip table and continue on to lookup the street address
from the user provided information, and return a list of matches to the
caller.
 
In RPGIV I am overloading the data structure by using the first 10 bytes of
the structure to "name" the format and using the larger of the two
structures as the procedure return variable definition. The calling code
looks a the first 10 bytes and determines if the API is returning the
City/State/Zip structure or the Address structure and does the appropriate
processing.
 
Now, finally, to my question. If the caller is a Java method can it
determine, using the first 10 bytes, if the object/structure returned to it
is a City/State/Zip or Address object?
 
Is there a better way to handle structure/object return value overloading
for RPGIV/Java?
 
Thanks
Duane Christen



NOTICE: This electronic mail transmission may contain confidential
information and is intended only for the person(s) named.  Any use, copying
or disclosure by any other person is strictly prohibited. If you have
received this transmission in error, please notify the sender via e-mail.




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.