Solved

# Expanding formula statement automatically.

Posted on 2004-09-14

Hi All,

Given these 2 formulas of y =....... which are dependent on the number of atoms.length, and they appear to be consistantly applied, I want to make the formulas appear so that as the number of atoms.length increased causes the formula y =....... to expand accordingly.

This is demonstrated in the two situations below:

............. start of snip

int atmlength = atoms.length;

if (atmlength == 3) // 2nd degree

{

y = Float.parseFloat(atoms[atoms.length-1]) +

gofrmX*(Float.parseFloat(atoms[atoms.length-2]) +

gofrmX*Float.parseFloat(atoms[atoms.length-3]));

}

if (atmlength == 4) // 3rd degree

{

y = Float.parseFloat(atoms[atoms.length-1]) +

gofrmX*(Float.parseFloat(atoms[atoms.length-2]) +

gofrmX*(Float.parseFloat(atoms[atoms.length-3]) +

gofrmX*Float.parseFloat(atoms[atoms.length-4])));

}

end of snip...........

Delphi3