.; INIT.IND .; .; One-time initialization of device (designed originally for VM:) .; .; Can be called with parameters, as IND INIT.IND VM: Virtual BSchor .; Optional 4th parameter, switches (INIT INIT.IND vm: Virtual BSchor /seg:2) .; Note that name and owner parameters must not have embedded blanks .;**************************************************************; .; ; .; Copyright (c) 1989 Bob Schor ; .; Eye and Ear Institute ; .; 203 Lothrop St. ; .; Pittsburgh, PA 15213 ; .; ; .; All rights reserved. May not be copied without this notice. ; .; ; .;**************************************************************; .; Version 9.3 -- first incarnation .; Version 9.3 -- optional fourth parameter, init switches .;initialization .enable quiet .enable substitution .disable suffix .disable prefix .sets versn "INIT, Version 9.3" ; ;'versn' ; .sets device p1 .if device <> "" .goto in1 .asks device Enter device name -- .in1: .if device = "" .sets device "dk:" .test device ":" .if = 0 .sets device device+":" .; See if it is possible to open a file on the device. If it is, .; the device exists, with a directory, so exit immediately. dir/output:nl: 'device' .if = .exit .; Cannot open a file on device, so try to initialize. Allow user to .; specify volume id and owner. ;INIT - I - disregard DIR error, will initialize 'device' .sets volid p2 .test volid .if = 0 .sets volid "NewDevice" .sets owner p3 .test owner .if = 0 .sets owner "BSchor" .sets flags p4 .test flags .setn len .test flags "/" .if = 1 .sets flags flags[2:len] .test flags .if > 0 .sets flags "vol/noquery/'flags'" .if = 0 .sets flags "vol/noquery" .; Now build .COM file to initialize device .open init.tmp .data init/'flags' 'device' .data 'volid' .data 'owner' .data delete init.tmp .close .; Finally, execute it $@init.tmp .if = .exit ; ;INIT - W - Initialization of 'device' failed. ; .exit