Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: F$GETDVI

Original Message
Name: Scott Halet
Date: April 30, 2002 at 06:30:03 Pacific
Subject: F$GETDVI
Comment:
I am new to DCL. I am trying to write a script which will get the device information and then make a judgement on that information:
The following is what I have:

$ disk_loop:
$ p1 = f$device("*","disk")
$ if p1 .eqs. "" then goto done ! EXIT ON NO DISKS
$!
$ if f$locate(f$getdvi(''p1',"device_type_name"),"RZ") .nes. ""
$ then
$ write sys$output "''p1' is a disk"
$ else
$ endif
$ goto disk_loop
$ done:
$ exit

I believe the lexcial I am using is wrong. If someone has any thoughts please advise, thanks.


Report Offensive Message For Removal

Response Number 1
Name: ME
Date: April 30, 2002 at 12:09:52 Pacific
Subject: F$GETDVI
Reply: (edit)
You're almost there. Biggest problem is in the line with f$locate.
- f$locate() returns an integer of the position where it finds the specified substring, or the length of the string when the substring isn't found.
- f$getdvi needs only the symbol p1, without quotes. You use the quotes only when the symbol has to be translated in a string like "''p1'"
It is best to split the specified line in two lines like :
$ thisdev = f$getdvi(p1,"device_type_name")
$ if f$locate("RZ",thisdev) .ne. f$length(thisdev)
Note that I also changed .nes. in .ne. because you do a comparison of integers, not strings.

One other remark :
P1 - P8 are special symbols (input parameters). I wouldn't
use them for 'normal' symbols. So I would change the line
$ p1 = f$device("*","disk")
in something more meaningful like
$ mydisk = f$device("*","disk")



Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: F$GETDVI

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC