procedure TForm1.SomeMethod(aParam1: Pointer);
begin
{$IFOPT ASSERTIONS}
//按照设计,aParam1不能为nil
if not (aParam <> nil) then
AssertErrorProc('aParam1不能为nil', UnitName, LineNumber, ErrorAddr);
//或者
if not (aParam <> nil) then
AssertErrorProc('', UnitName, LineNumber, ErrorAddr);
//也可以断言,在执行SomeMethod,TForm1必定处于某种状态
if not (not Visible) then
AssertErrorProc('', UnitName, LineNumber, ErrorAddr);
{$IFEND}