[Info-vax] Notable VMS "feature"

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Thu Jan 28 10:02:36 EST 2016


In article <n8d3v9$8l3$1 at Iltempo.Update.UU.SE>, Johnny Billquist <bqt at softjar.se> writes:
>On 2016-01-28 03:18, VAXman- at SendSpamHere.ORG wrote:
>> In article <n8bj49$u3u$1 at Iltempo.Update.UU.SE>, Johnny Billquist <bqt at softjar.se> writes:
>>> On 2016-01-27 12:54, VAXman- at SendSpamHere.ORG wrote:
>>>> In article <n89ec2$1bpl$1 at gioia.aioe.org>, George Cornelius <cornelius at charter.NOWHERE.net> writes:
>>>>> On 01/26/2016 06:31 AM, Jess Goodman wrote:
>>>>>> On Sunday, January 24, 2016 at 3:40:18 PM UTC-5, gcorn... at charter.net wrote:
>>>>>>> gcornelius at charter.net wrote:
>>>>>>>> gcornelius at charter.net wrote:
>>>>>>>>> The rest is of course stolen from you.
>>>>>>>
>>>>>>> Except the part where I forgot the parentheses
>>>>>>> about istat.and.1 in the if statement.
>>>>>>>
>>>>>>> I believe the simplified form
>>>>>>>
>>>>>>> 	if (istat.and.1)  ! no .eq.1
>>>>>>>
>>>>>>> would work, though, so no need to have compared
>>>>>>> the results of the .and. to 1.
>>>>>>>
>>>>>>> George
>>>>>
>>>>>> Actually in VMS Fortran (and in DCL) only the low-order bit of a
>>>>>> logical value determines if it is TRUE or FALSE.  I remember this
>>>>>> as "truth is odd".  And since for VMS status values "success is
>>>>>> odd" you can code this way:
>>>>>
>>>>> And I code that way in DCL. In Fortran, which is
>>>>> a standards-based language, I have begun to think
>>>>> that even if it is low bit only it is best to make
>>>>> it explicit.
>>>>
>>>> Then wouldn't be be more "explicit) with...
>>>>
>>>>           INCLUDE '($STSDEF)'
>>>>
>>>>           if (istat.and.STS$M_SUCCESS)
>>>
>>> Isn't there a mask that contains all the bits that should be checked for
>>> status? And then you should really mask istat with that, and check if
>>> the masked value equals success?
>>
>> "M" ;)
>
>I was wondering about that, but is STS$M_SUCCESS is a mask, your code 
>don't make sense, as errors would also result in a non-zero value. Or is 
>STS$M_SUCCESS a mask that only includes the bits that indicates 
>success/no success?
>
>Hmm, I bet it is. So I would guess that it's a mask with just one bit?
>
>Oh well. In which case I agree with other comments still, it's better to 
>still check that the result value actually equals success, than just 
>assuming that the success value is actually when it is non-zero, and 
>that any non-zero value from an expression is interpreted as .TRUE.
>
>
>Making up names, I would prefer something like:
>
>IF ((istat .AND. STS$M_STATUS) .EQ. STS$C_SUCCESS)


IF ((istat .AND. STS$M_SEVERITY) .EQ. STS$K_SUCCESS) ...

Howver, in that case, you'd be assuming that in information code was an
error unless you check for that too.

IF (((istat .AND. STS$M_SEVERITY) .EQ. STS$K_SUCCESS) .OR.
    ((istat .AND. STS$M_SEVERITY) .EQ. STS$K_INFO) ...

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.



More information about the Info-vax mailing list