Re: Error Number to Symbol

Liste des GroupesRevenir à co vms 
Sujet : Re: Error Number to Symbol
De : brown_mi (at) *nospam* decuserve.org (Michael Brown)
Groupes : comp.os.vms
Date : 19. Mar 2025, 16:34:04
Autres entêtes
Organisation : House Harris Software
Message-ID : <cf0fd2051b47046cca45926ef1fb1e73c87024df@i2pn2.org>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
This is gold!, thank you for this question fully answered. I can polish up my error handling routines now.
On 19/3/25 01:01, Arne Vajhøj wrote:
On 3/18/2025 9:56 AM, Arne Vajhøj wrote:
On 3/18/2025 1:58 AM, Lawrence D'Oliveiro wrote:
On Tue, 18 Mar 2025 16:24:46 +1100, Michael Brown wrote:
Working in C, how do you return the RMS$_CODE symbol for any given error
number as returned from any operation?
>
The $GETMSG system service comes to mind. I see there is a library routine
LIB$SYS_GETMSG, not sure what that does that the system service call does
not.
>
Classic LIB$ SYS$ difference in API style:
>
                                   SYS$                LIB$
optional arguments         require placeholder   can be omitted
readonly integer argument       by value          by reference
string arguments            fixed length only      dynamic ok
 In C it is just different:
 #include <stdio.h>
#include <stdint.h>
 #include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
 int main(int argc, char *argv[])
{
     char msg[256];
     int32_t code, stat;
     int16_t msglen;
     $DESCRIPTOR(msgdesc, msg);
     code = 98962;
     stat = lib$sys_getmsg(&code, &msglen, &msgdesc);
     msg[msglen] = 0;
     printf("stat=%d msg=|%s|\n", stat, msg);
     stat = sys$getmsg(code, &msglen, &msgdesc, 0, 0);
     msg[msglen] = 0;
     printf("stat=%d msg=|%s|\n", stat, msg);
     return 0;
}
 
--
House Harris Software.
Making the world a safer place for our products.
https://eisner.decus.org/~brown_mi

Date Sujet#  Auteur
18 Mar 25 * Error Number to Symbol7Michael Brown
18 Mar 25 +* Re: Error Number to Symbol5Lawrence D'Oliveiro
18 Mar 25 i`* Re: Error Number to Symbol4Arne Vajhøj
18 Mar 25 i +* Re: Error Number to Symbol2Arne Vajhøj
19 Mar 25 i i`- Re: Error Number to Symbol1Michael Brown
18 Mar 25 i `- Re: Error Number to Symbol1Arne Vajhøj
18 Mar 25 `- Re: Error Number to Symbol1Jim Duff

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal