|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 1 to 1 of 1 total|
|small bug, interesting AI project|
|Tue, Feb 23 2021 6:18 PM||Permanent Link|
Bug in prototypes for external functions passing a procedure.
I was porting an interesting Artificial Intelligence project. It tracks a face on camera. Fun!
https://erickengelke.com/faces/faces.html (it has to be https for permissions for your camera)
When porting from EWB2 to EWB3 and came across a strange compiler bug: if you declare an external function that is passed a local function as a parameter, EWB balks at the definition.
The solution that works is to declare pointer to the function and then pass that. But it didn’t used to be necessary in EWB2.
The following simple code will not compile in EWB3 but does in EWB2!
TDrawLandMarks = procedure (results : variant); // local function
external TOnPlay = function ( videoE1 : variant; options : variant ; drawlandmarks :TDrawLandMarks ): array of variant;
external onPlay2 :TOnPlay;
procedure DrawLandmarks2( results : variant );
Form1.localdrawlandmarks( results );
playoptions : variant;
playoptions := 0;
// next line fails, wanting an integer or variant, or whatever, but not accepting the function
face3 := onPlay2( videoE2, playoptions, drawLandmarks2 );
EWB Programming Books and Component Library
This web page was last updated on
Friday, March 17, 2023 at 10:08 PM
© 2023 Elevate Software, Inc. All Rights Reserved
Questions or comments ? E-mail us at firstname.lastname@example.org