Kevin writes:
> I am looking for an intrinsic that I can call from a COBOL program
> to determine if a printer device exists. We need to allow our users to
> enter a device name on a view form. Does anyone know of such a beast?
The old fashioned low-tech way to do this is to call the COMMAND
intrinsic to attempt to issue a file equation with DEV=whatever the
user entered. The :FILE command validates that this device exists,
so you can check the intrinsic status to see if the command was
accepted or not.
So if the user enters "NARF" as the device, you try to execute:
:FILE FOO;DEV=NARF<CR>
or something similar, and see if you get back an error or not.
The only other way I know of (offhand) would involve either a call to
a privileged undocumented system routine, or using the Architected
Interface (AIF) facility which you have to buy from HP (for $500 or
something like that).
HP tried to change the :FILE command a while back to have it NOT
validate the device parameter (since it's none of :FILE's business
whether or not the device name is valid) but this broke so many
programs that already used the above logic that they had to put it
back. So using the :FILE command to test for device validity is
likely to work forever.
G.