SomeClass := TSomeClass.Create(nil);if SomeClass <> nil then Flag_Initialized := False;else Flag_Initialized := True;
SomeClass = new TSomeClass();if (SomeClass != NULL) Flag_Initialized = False;else Flag_Initialized = True;
C++ (Qt)SomeClass = new TSomeClass();if SomeClass <> nil then
C++ (Qt) try { SomeClass = new TSomeClass();}catch (FooError& e) {// ...code that handles "foo" errors...}
DelphiSomeClass := TSomeClass.Create(nil);try SomeClass.DoIt();finally FreeAndNil(SomeClass);end;