Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Casting an expression / wrong translation
Mon, Mar 27 2017 11:32 AMPermanent Link

Michael Dreher

Example:

procedure TForm1.Form1Create(Sender: TObject);
var
  i1, i2 : integer;
  f : double;
begin
 // ...
 f := double(i1 + i2) * 0.001;
end;

The JS output is
 f = i1 + i2 * 0.001;   // JS
but should be
 f = (i1 + i2) * 0.001;  // JS

A work around is
 f := (double(i1 + i2)) * 0.001;   // pas

Michael Dreher
Mon, Mar 27 2017 12:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

Thanks, I'll make sure that this is fixed.  I'm sure that it's the cast that's tripping it up, so just remove that for now (it isn't necessary with JS, anyways).

Tim Young
Elevate Software
www.elevatesoft.com
Image