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



Mike,
The QUSROBJD will do the trick but it is slow, relatively speaking. If
performance is NOT an issue, I would suggest you us it and then check the
error data structure for a failed call.
You could also use CALLP(E) when you call the API using a prototype and then
check for %ERROR(). 
If performance is an issue, and I don't think it is in your case, you could
use the RSLVSP API (MI instruction) to get a pointer to the object. If
RSLVSP returns *NULL, then you know the object doesn't exist.
In the RPG xTools, I switched the CHKOBJEXTIST() procedure from using
QUSROBJD to RSLVSP and improved performance by a factor of 10 to 20. But
again, performance probably isn't an issue for you.
-Bob Cozzi


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Mike Wills
Sent: Friday, September 10, 2004 5:09 PM
To: Midrange_RPG400_L
Subject: Check to see if an object exists

I am looking for either a RPG or CL solution. With in a program I am
dynamically assigning an overlay to a PO based on the company. I want
to make sure this overlay exists before I assign to (error checking).
If the overlay doesn't exist, I apply a different overlay. Is there a
command or API that would make sure the object exists?

-- 
Mike Wills
iSeries Programmer/Lawson Administrator
koldark@xxxxxxxxx
http://www.koldark.net
Want Gmail? Email koldark+gmail@xxxxxxxxx to get on my waiting list.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-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.