[Info-vax] completion status from LIB$SPAWN
Michael Moroney
moroney at world.std.spaamtrap.com
Fri Apr 27 19:39:16 EDT 2012
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".
More information about the Info-vax
mailing list