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:
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)
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.
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.
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.