Re: Error Number to Symbol

Liste des GroupesRevenir à co vms 
Sujet : Re: Error Number to Symbol
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vms
Date : 18. Mar 2025, 15:07:10
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <67d97e0e$0$713$14726298@news.sunsite.dk>
References : 1 2 3
User-Agent : Mozilla Thunderbird
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
Dynamic string can be made to work with system service, but it
it is a little cumbersome.
Same Basic example:
$ bas/obj=msgfun sys$input
program msgfun
declare integer code, msglen, stat
declare string msg
external integer function sys$getmsg(integer by value, integer, string, integer by value, integer by value)
code = 98962
msg = "                                                                "
stat = sys$getmsg(code, msglen, msg, 0, 0)
msg = mid$(msg, 1, msglen)
print stat
print "|" + mid$(msg, 1, msglen) + "|"
end program
$
$ link msgfun
$ run msgfun
  1
|%RMS-E-FNF, file not found|
Arne

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