# desimal math problem

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..
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
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

Experts Exchange Solution brought to you by