procedure DoTheMessage; begin ShowMessage('Steve is the best!'); end; // In your code FooBar; if Foo then DoTheMessage; SomeMoreBar;