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



The first field in ERC0100_t is called Bytes_Provided in the documentation.  
It's an input to the API.  If you set it less than 8, the API sends escape 
messages for errors; if greater than 8, the API returns error info in the 
structure and sets Bytes_Available greater than zero.

I would code it like this:

 typedef struct {
     int Bytes_Provided;
     int Bytes_Available;
     char Exception_ID[7];
     char Reserved;
     char Exception_Data[240];
 } ERRC0100_t;

     ERRC0100_t errInfo;

     /* Verificar si existen las colas */

     memset(&errInfo, 0, sizeof(errInfo));
     errInfo.Bytes_Provided = sizeof(errInfo);

     memcpy(dtaq.lib, "QTEMP     ",
            sizeof(_TE_NAME_T));
     memcpy(dtaq.obj, "OUT_ABGQ  ",
            sizeof(_TE_NAME_T));
     memcpy(objType, "*DTAQ     ",
            sizeof(_TE_NAME_T));
     QUSROBJD(&objInfo, sizeof(objInfo),
              "OBJD0100", &dtaq,
              objType, &errInfo);

     if (errInfo.Bytes_Available > 0) {
       < do error processing >
     }

--Dave


On Wednesday 10 September 2003 12:21 pm, Carlos Kozuszko wrote:
> I want to call API QUSROBJD to check if an object
> exists or not. The API call is working but it sends an
> escape message terminating the program when an error
> occurs (file not found, etc.). How do i prevent this ?
> I want to use the info provided in the error area to
> check for the exception ID, but the program blows
> everytime the object is not found. When i call this
> API from an RPG program the program flow continues
> when an error occurs, how do i simulate this behavior
> ?
>
> Thanks in advance.
>
> Carlos Kozuszko.
>
>
> #include <stdlib.h>
> #include <qsnddtaq.h>
> #include <QUSROBJD.h>
> #include <qtes.h>
>
> typedef struct {
>     int Bytes_Returned;
>     int Bytes_Available;
>     char Exception_ID[7];
>     char Reserved;
>     char Exception_Data[240];
> } ERRC0100_t;
>
> void main() {
>     _TE_NAME_T objType;
>     _TE_OBJLIB_T dtaq;
>     Qus_OBJD0100_t objInfo;
>     ERRC0100_t errInfo;
>
>     /* Verificar si existen las colas */
>     memcpy(dtaq.lib, "QTEMP     ",
>            sizeof(_TE_NAME_T));
>     memcpy(dtaq.obj, "OUT_ABGQ  ",
>            sizeof(_TE_NAME_T));
>     memcpy(objType, "*DTAQ     ",
>            sizeof(_TE_NAME_T));
>     QUSROBJD(&objInfo, sizeof(objInfo),
>              "OBJD0100", &dtaq,
>              objType, &errInfo);
> }
>
>
> ------------
> Internet GRATIS es Yahoo! Conexión
> 4004-1010 desde Buenos Aires. Usuario: yahoo; contraseña: yahoo
> Más ciudades: http://conexion.yahoo.com.ar



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.