[Delphi]not演算子の使用例






トップページへ

※全てのDelphi(楽天市場で探すamazonで探す)で動作する保証はありません。また、内容に関し管理人は全ての責任を負いかねます

サンプル ※説明に必要な部分しか記述していません

procedure TForm1.Button1Click(Sender: TObject);

//フォーム上に TProgressBar, TLabel を各1個、TButton を2個配置し、Label1.Captionを 使用可 とします

var
    i: Integer;

begin
    ProgressBar1.Max := 10;
    ProgressBar1.Position := 0;


    Button2.Enabled := not Button2.Enabled;


    if not(Button2.Enabled) then begin
        Label1.Visible := False;
    end
    else begin
        Label1.Visible := True;
    end;

 

    if Button2.Enabled then begin
        Exit;
    end;


    i := 1;


    //「iが6以上」ではない、つまり「iが6未満」の間、繰り返し
    while not(i >= 6) do begin

        ProgressBar1.StepBy(1);
        i := i +1;

    end;


end;

Button1 のクリックの度に切り替わります

 






関連記事
[Delphi]算術演算子

[Delphi]ファイルの読込み AssignFile, Readln

[Delphi]例外処理 try except

[Delphi]入力ダイアログボックス InputBox

[Delphi]動的配列 array of