in Delphi TIPS :: Delphi's ShowMessage procedure, defined in the dialogs.pas unit, displays a message in a dialog box, waits for the user to click an OK button.
I'm using the ShowMessage procedure frequently while developing applications as a "debugging" tool to display values of various variables, properties, function results.
A downside of the ShowMessage is that it only accepts a string parameter - where variables tend to be integers, bools, floats, etc. :)
Read the full article to learn how to Overload ShowMessage to accept Integer, Boolean, Float, ...
Related:

This is a great, neat trick.
You could also use a shorter procedure name, like
procedure Sm(S: String), just to save some typing when calling.And even smarter: You could create some overrided procedures with multiple parameters, like:
procedure Sm(S: String; I: Integer);
begin
ShowMessage(S + ': ' + IntToStr(I));
end;
that way you can make some additional comments:
Sm('RandomValue', Random(1000));
There is no need to overload ShowMessage when there is ShowMessageFmt. It fits all my needs. E.g.:
ShowMessageFmt(‘String %S, Integer: %D’,['Test', 123]);
What’s wrong with using the debugger and IDE property where you can inspect values or variables etc, you also have
OutputDebugString, also means your less likely to leave showmessage statements in the code by accident!