HP3000-L Archives

February 1997, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
[log in to unmask][log in to unmask] writes:
> Here's a sample of what I'm doing inside a PERL script:
>
> $ciline = 'callci "purge foo.pub"' ;
> @outline = $ciline ;
> print `@outline` ;

...deletia...

> When I run perl -v I get
>
> This is perl, version 4.0

Throw away this obsolete version of Perl and either obtain 5.002 that is
bundled with gcc on http://jazz.external.hp.com, or get 5.003 from
ftp://ftp.orbitsw.com/pub/perl5.003.mov.gz. [...]46_12Feb199715:24:[log in to unmask]
Reply To:
Date:
Tue, 11 Feb 1997 15:02:18 -0800
Content-Type:
text/plain
Parts/Attachments:
[HP3000-L] (31 lines)
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.

ATOM RSS1 RSS2