[Info-vax] completion status from LIB$SPAWN
VAXman- at SendSpamHere.ORG
VAXman- at SendSpamHere.ORG
Fri Apr 27 19:53:12 EDT 2012
In article <jnfan4$dr$1 at pcls6.std.com>, moroney at world.std.spaamtrap.com (Michael Moroney) writes:
>Hein RMS van den Heuvel <heinvandenheuvel at gmail.com> writes:
>
>>On Friday, April 27, 2012 10:34:33 AM UTC-4, David Froble wrote:
>>> StGallen wrote:
>>:
>>> specifies success or failure. Don't test the value, do a mask comparison, ie;
>>>
>>> If (Stat% And SS$_NORMAL)
>>> Then Print "Success"
>>> Else Print "Failure"
>>> End If
>
>>I beg to differ. That's disgusting code.
>>It may work, but does not does what it suggest.
>
>>SS$_NORMAL is NOT a bitmask, it is a word value.
>>That only works because you know its value is 1.
>>If so, then IMHO it is better just write that: stat & 1
>>Or use STS$M_SUCCESS as mentioned earlier,
>>Or use a 16-bit-word-compare.
>
>Very true, and I see it all the time. I've learned to overlook/ignore it.
>When I write code, I just use "1".
Sheesh... C'mon, it's STS$M_SUCCESS. This is VMS with 30 years+ history.
You'd think people could/would be able to get it right by now.
FWIW, that BASIC stuff if fugly.
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
Well I speak to machines with the voice of humanity.
More information about the Info-vax
mailing list