Hi,
we are trying to create what we thought was a quick if then else loop to convert a string to a number and then multiply the values. Can anyone see why the formula below won't run? It says "The remaining text does not appear to be part of the formula". It runs without error if I remove the else. But without the else it runs all the code. Can you help?
numbervar stepmeasacr;
numbervar stepmeasrou;
numbervar stepnoacr;
numbervar stepnornd;
numbervar totalacr;
numbervar totalrnd;
numbervar totalinch;
If
NumericText({TechnicalSpec.StepMeasAcr})
and NumericText({TechnicalSpec.StepMeasRnd})
and NumericText({TechnicalSpec.StepNoAcr})
and NumericText({TechnicalSpec.StepNoRnd})
then
stepmeasacr := CDbl ({TechnicalSpec.StepMeasAcr});
stepmeasrou := CDbl ({TechnicalSpec.StepMeasRnd});
stepnoacr := CDbl ({TechnicalSpec.StepNoAcr});
stepnornd := CDbl ({TechnicalSpec.StepNoRnd});
totalacr := stepmeasacr * stepnoacr;
totalrnd := stepmeasrou * stepnornd;
totalinch := (totalacr * totalrnd) / 25.4;
else
0;
we are trying to create what we thought was a quick if then else loop to convert a string to a number and then multiply the values. Can anyone see why the formula below won't run? It says "The remaining text does not appear to be part of the formula". It runs without error if I remove the else. But without the else it runs all the code. Can you help?
numbervar stepmeasacr;
numbervar stepmeasrou;
numbervar stepnoacr;
numbervar stepnornd;
numbervar totalacr;
numbervar totalrnd;
numbervar totalinch;
If
NumericText({TechnicalSpec.StepMeasAcr})
and NumericText({TechnicalSpec.StepMeasRnd})
and NumericText({TechnicalSpec.StepNoAcr})
and NumericText({TechnicalSpec.StepNoRnd})
then
stepmeasacr := CDbl ({TechnicalSpec.StepMeasAcr});
stepmeasrou := CDbl ({TechnicalSpec.StepMeasRnd});
stepnoacr := CDbl ({TechnicalSpec.StepNoAcr});
stepnornd := CDbl ({TechnicalSpec.StepNoRnd});
totalacr := stepmeasacr * stepnoacr;
totalrnd := stepmeasrou * stepnornd;
totalinch := (totalacr * totalrnd) / 25.4;
else
0;