Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# desimal math problem

Posted on 1997-06-11
Medium Priority
203 Views
using a math problems to caoculate Speeds and Feeds on CNC machines.  Basic program tried

var
A, B                 :String[6];
N1,D1,X1, Ans, Ans1  :????; {used Integer and Real}
begin
N1:=300.0
D1:=1.500
X1:=3.82
Ans:=X+1N+1D1);
Ans1:=3.82+1.5+300.0
Str(ans,A);
Str(Ans1,B);
Label1.Caption:=A;
Label2.caption:=B;

When I used these I got the correct answer for B and an off the wall answer for A

The two formulas I'm trying to use are

RPM=FPM( Drill Size / material type)
3.82   .500         300

IPM= RPM X Dia.

Please have a sample of the code.  I get more out of looking at code than reading text and manuals..
0
Question by:jim zerbe
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
1 Comment

LVL 3

Accepted Solution

hpierson earned 150 total points
ID: 1336976
I actually went to the trouble of typing in your program, and running it (using the type real). It worked perfectly after I corrected your typos, in particular:

ans := X1 + N1 + D1;

and putting semi colons at the end of each statement.

Look at your code carefully. The first time I type this, I left out the above line, and since this left ans undefined (and filled with garbage), when I converted from real to string, I got off the wall garbage...<g>
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
###### Suggested Courses
Course of the Month5 days, 10 hours left to enroll