PL/I CAN 16

From: robin (robin_v_at_bigpond.mapson.com)
Date: 12/30/03


Date: Tue, 30 Dec 2003 06:06:21 GMT


> 16. CANT output bitfield DIRECTLY from integer value in 1 statement

FALSE. FRANK WAS SHOWN THIS A WEEK OR SO AGO.

PUT (SUBSTR(VALUE, M, N));

The corresponding declaration is:

DCL VALUE FIXED BINARY (31) INIT ('12345678'XN);

> ! ----------------------
> program output_bits ! from bitfield n:m
> integer :: value = #12345678 ! hex constant
> integer :: n = 3, m = 25
> write (*,'(99i0)') ishft(value,[-m:-n]).and.1
> end program
> Output: 10001101000101011001111
> 2 3 4 5 6 7 8



Relevant Pages

  • Re: Any reason why this would fail ?
    ... TEST40: PROCEDURE OPTIONS; ... DCL I FIXED BININIT; ... I admit that I can't imagine myself ever wanting to use a numeric character variable as in this example, but if ever I came upon a good reason for wanting to do so and it didn't work I'd be pretty annoyed. ...
    (comp.lang.pl1)
  • Re: Any reason why this would fail ?
    ... TEST40: PROCEDURE OPTIONS; ... DCL I FIXED BININIT; ... "Only an idiot fights a war on two fronts. ...
    (comp.lang.pl1)
  • Re: Text Areas and drawString
    ... you need to move the declaration of the TextArea out of the ... If you declare it within the init method, ... As for using the CheckBoxes, you'll need to implement the ItemListener ...
    (comp.lang.java.help)
  • Re: Any reason why this would fail ?
    ... TEST40: PROCEDURE OPTIONS; ... DCL I FIXED BININIT; ... That's because it's a compiler bug, ...
    (comp.lang.pl1)
  • Any reason why this would fail ?
    ... TEST40: PROCEDURE OPTIONS; ... DCL I FIXED BININIT; ... Under PL/I for MVS&VM, this prints 'HELLO' twice, and 'BYE' once. ...
    (comp.lang.pl1)