Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 2 of 2 total |
Overloaded function problem / wrong JavaScript output |
Thu, Jul 27 2017 3:45 AM | Permanent Link |
Michael Dreher | I've declared classes and overloaded functions
// type TCell = class end; // TCellIterator = class public procedure Reset; end; // // function IFF(condition : boolean; const c1, c2 : TCell) : TCell; // function IFF(condition : boolean; i1, i2 : integer) : integer; and applied the IFF function // procedure TCellIterator.Reset; // var i : integer; // begin // i := IFF(3 > 0, 0, -1); // end; The JS output is // cells_tcelliterator.$p.reset = function() // { // var $t = this, i; // i = (3 > 0, 0, -1); // (*) // }; (*) is valid JavaScript; an assignment to a comma operator expression resulting to -1. But I expected an assignment to the return value of a function call. The function name is missing here. The IFF functions are implemented in different units. When I merge both functions into a single unit, the JS output is correct. The source code is in the attachment. Michael Dreher Attachments: Example.zip |
Thu, Jul 27 2017 10:46 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Michael,
<< (*) is valid JavaScript; an assignment to a comma operator expression resulting to -1. But I expected an assignment to the return value of a function call. The function name is missing here. >> I'll check it out. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 5, 2024 at 07:30 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |