Semicolons in Delphi
A semicolon in Delphi indicates the end of a statement. As a novice, I often make mistakes like this:
1. In a conditional judgment statement, a semicolon is used in the middle
As follows:
It's not necessary to write in the red circle in the picture. If you write a semicolon, the following statement becomes else if....
Note: the above code can be replaced with the following code:
Procedure TForm1.btn1MouseDown (Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); const s: Array [0.. 2] of string= ('left button', 'right button', 'middle button'); beginshowmessage (sord (button)]); mbleft;end;end.