Solved

desimal math problem

Posted on 1997-06-11
1
200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

728 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