/* acf4:comp.os.vms / ISIS08@ECOSTAT.AAU.DK /  5:02 am  Nov 27, 1990 */
>   pardon a novice programmer, but could anyone give me some advice on how
> to get a list of all devices in the system, such as MBA, TT, both virtuall
> and physical? (I guess I could read SYSTARTUP_V5.COM for physical, but
> that's not what I'm after. I want to get it in a routine in MACRO32,
> and not SHOW DEVICE) :)

At the bottom of this mail is a small MACRO-32 routine (if you
want MACRO - then you will get MACRO) and a FORTRAN program calling it,
which demonstrates how to make a SHOW DEVICE using SYS$DEVICE_SCAN.

                                                           Arne

Arne Vajhxj                             Internet: ISIS08@ECOSTAT.AAU.DK
Institute of Economics and Statistics   PSI:      DATAPAX.23830211371400::ISIS08
Aarhus University
Denmark

--------------------------------------------------------------------------------

DVISCAN.MAR
-----------

        .title  dviscan
        $SSDEF
        .psect  $LOCAL long,pic,con,lcl,noshr,noexe,wrt
argl_devicescan:
        .long   5
        .blkl   1                       ; return name
        .blkl   1                       ; return length
        .long   0                       ; search
        .long   0                       ; item-list
        .address cntx                   ; context
cntx:   .blkq   1
        .psect  $CODE long,pic,con,lcl,shr,exe,nowrt
        .entry  dviscan,^m<iv>
        movl    B^4(ap),argl_devicescan+4
        movl    B^8(ap),argl_devicescan+8
        callg   argl_devicescan,G^SYS$DEVICE_SCAN
        cmpl    r0,#SS$_NORMAL
        bneq    100$
        movl    #-1,r0
        ret
100$:   movl    #0,r0
        ret
        .end

SHOWDEV.FOR
-----------

      PROGRAM SHOWDEV
      INTEGER*4 DVILEN(1000),N,I
      CHARACTER*32 DVINAM(1000)
      LOGICAL*4 DVISCAN
      N=0
100   IF(DVISCAN(DVINAM(N+1),DVILEN(N+1))) THEN
        N=N+1
        GOTO 100
      ENDIF
      DO 200 I=1,N
        WRITE(*,*) DVINAM(I)(1:DVILEN(I))
200   CONTINUE
      END
/* ---------- */

