Solved

desimal math problem

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now