Solved

desimal math problem

Posted on 1997-06-11
1
202 Views
Last Modified: 2010-04-06
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
Comment
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
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
hpierson earned 50 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month6 days, 19 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question