문제

I have this line of code throwing up the above error:

server:=TIdHTTPServer.Create;
server.OnQuerySSLPort(8092,true);

I've read about using the right vars/constants but that doesn't seem to work.

Any help, appreciated

도움이 되었습니까?

해결책

A var parameter is passed by reference (that is, the method doesn't want only a value, but a variable (which comes with a value), which it can alter if necessary), so you need to pass a variable (of the right type), not only a value. This works:

var
  mybool: boolean;
begin
  mybool := true;

  server := TIdHTTPServer.Create;
  server.OnQuerySSLPort(8092, mybool);
  // Now mybool can be either true or false; it's up to the method.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top