User manual...

Hello,

From the user manual:

function MessageBox lib "User32.dll" alias "MessageBoxA" stdcall
(hwnd as pointer, text as string, caption as string, msgtype as integer) as int
eger

produces this:
image

This is correct:

function MessageBox lib "User32.dll" alias "MessageBoxA" stdcall
(hwnd as pointer, text as AnsiString, caption as AnsiString, msgtype as integer) as integer

MessageBox(0, "The code executed.","Code status message...",0)

image

Also UINT is not support but can be successfully complied but fails with a runtime error.

function MessageBeepP(uType: UINT): BOOL; stdcall;
                     external 'user32.dll' name 'MessageBeep';
begin
 MessageBeepP(0);
end;

This is my first time using Scripter with Basic and I am verifying a bunch of examples in Pascal, converted to Basic. Verifying "everything" has prompted the last two post.

Cheers,

Mark

function MessageBeepP(uType: UINT): BOOL; stdcall;
                     external 'user32.dll' name 'MessageBeep';
begin
 MessageBeepP(0);
end;

Update: I just noticed changing UINT to asdf also compiles.

The documentation is not necessarily wrong, it depends on the Delphi version you are using. In Pre-unicode Delphi versions, string is equivalent to AnsiString.

But we will change the example to use MessageBoxW so it's compatible with latest Delphi versions.

Scripter accepts any identifier as parameter types, but only those listed as supported are accepted.

Thanks for the response.

Yes, knew about the per-unicode versions. I was pointing it out because, the manual does not specify.

Scripter accepts any identifier as parameter types, but only those listed as supported are accepted.

Is that another way of saying the compiler does not check the parameter type against a list of supported types and lets the error get flagged at runtime? Because that is what is happening and it confused me. Not sure why UINT is not flagged as unknown type at compile time.