Why the second condition never happen, even if "Exp" is obviously =0 ?
Simple project with one button.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
TExponent = 1..30;
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
Exp: TExponent;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
WriteLn('Exp is: '+inttostr(Exp));
if Exp=0 then WriteLn('Exp is ZERO');
end;
end.
Output is only "Exp is: 0" and that's all.
Probably it is optimalized ...
Thanks.
EDIT: Directive {R+} does not help either.