Undeclared identifier: MessageBeep

Hi,

The MessageBeep function for now is undeclared, according to TMS Web Core documentation the function should be in WEBLib.WebTools. Is something changed in version 1.9.8.3?

MessageBeep() is in Core Source\WEBLib.WebTools.pas

it is strange ... I have ... WEBLib.WebTools.pas in AppData\Local\tmssoftware\registered\TMS WEB Core RSXE14\Component Library Source and I dont see this function, in attachement pas file
WEBLib.WebTools.pas (4.8 KB)

pas2js compiler compiles with code in:
AppData\Local\tmssoftware\registered\TMS WEB Core RSXE14\Core Source

I know that the compilation is working ... but the error is displayed in the Delphi 11.1 IDE code insight.

In attachement simple project contains code which is on the picture ... what should I do to get rid of this error?

Test.zip (1.6 MB)

It was a code-insight issue only.
We fixed it now. Next update will have this fix.

Ok ... thx ... but one more code-insight question concerning RawInvoke function, I don't know why I have info like below

I see in AppData\Local\tmssoftware\registered\TMS XData\source\core\XData.Web.Client.pas function with exactly the same parameters

procedure RawInvoke(const OperationId: string; Args: array of JSValue; SuccessProc: TXDataClientLoadProc; ErrorProc: TXDataClientErrorProc = nil); overload;

Project in attachement:

Test2.zip (1.8 MB)

Unfortunately Pas2JS requires a @ before the name of the procedure when passing the SuccessProc parameter, while Delphi DCC doesn't. One workaround is to write your code like this:

procedure TForm1.wbtn1Click(Sender: TObject);
begin
  Self.xdataclnt1.RawInvoke('aaa',['aaa','abb'],
    procedure(Response: TXDataClientResponse)
      begin
        //
      end);
end;

Ok ... thanks ... the anonymous methods are great :grinning:

1 Like