我具有以下功能,导致“分号丢失”。错误”,但我不明白为什么。
感谢您的帮助!
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
if not IsServiceRunning('oscmaintenanceserver') then
begin
MsgBox('Service not running. Exit.', mbInformation, MB_OK);
exit;
end
end
if not StopService('oscmaintenanceserver') then
begin
MsgBox('Service couldnt be stopped.', mbInformation, MB_OK);
exit;
end
end
if not RemoveService('oscmaintenanceserver') then
begin
MsgBox('Couldnt remove service.', mbInformation, MB_OK);
exit;
end
end
begin
MsgBox('All went fine :-).', mbInformation, MB_OK);
exit;
end
end;
end
每个if
分支机构都有一个额外的成员。此外,标记语句的结尾时,end
需要在其后加上分号。
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
if not IsServiceRunning('oscmaintenanceserver') then
begin
MsgBox('Service not running. Exit.', mbInformation, MB_OK);
exit;
end;
if not StopService('oscmaintenanceserver') then
...
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句