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: more DCL help

Original Message
Name: peterc
Date: June 24, 2003 at 02:51:22 Pacific
Subject: more DCL help
OS: VMS alpha
CPU/Ram: dont know
Comment:
Hia,
thanks ME, I didnt know you could use ' like that. Ive got a few character strings that are decimal numbers, and I need to add and multiply them together, leaving a resulting character string which is to become part of the ouput-file name. when I try to add them using f$string or f$integer the result is zero. What am I doing wrong?
Cheers.

Report Offensive Message For Removal

Response Number 1
Name: ME
Date: June 24, 2003 at 17:03:21 Pacific
Subject: more DCL help
Reply: (edit)
An example of what should work :

$ string1 = "ABC123"
$ string2 = "DEF456"
$ int1 = F$INTEGER(F$EXTRACT(3,3,string1))
$ int2 = F$INTEGER(F$EXTRACT(3,3,string2))
$ int3 = int1 + int2
$ string3 = "GHI" + F$STRING(int3)

string3 should have the value "GHI579" now.

Maybe you could post an example of what you're doing.
And maybe someone else could look at it, because I'm off on a holiday !



Report Offensive Follow Up For Removal

Response Number 2
Name: peterc
Date: June 25, 2003 at 06:08:15 Pacific
Subject: more DCL help
Reply: (edit)
Hi,
Thanks again ME, the solution you gave me is great, unfortunately the numbers I want to extract from a string have decimal places, so it obviously breaks down when I call F$INTEGER. Any ideas?
cheers.


Report Offensive Follow Up For Removal

Response Number 3
Name: Tiberius
Date: July 16, 2003 at 17:37:42 Pacific
Subject: more DCL help
Reply: (edit)
If you really intend on doing decimal math using DCL, you are probably going to have to write an extensive DCL command file to accomplish it. It would be lots easier to read the datafile using a C program or somesuch, but if you need to use DCL, try F$LOCATE() to get an index to the decimal point, then use F$LENGTH() and F$EXTRACT() to pull out the integer portion to the left of '.' and the integer portion to the right of the '.', then perform the math and put it back together. I hope this helps.

Tiberius


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: more DCL help 

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