掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
複数のコンボボックスで絞込み (ID:44406)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
ComboBoxだけど var StringList: TStringList; I: Integer; C1: String; B: Boolean; Result: String; //結果 begin StringList := TStringList.Create; StringList.AddObject(ComboBox1.Text+ '=' + Char(39) + Edit1.Text + Char(39) , TObject(ComboBox1.ItemIndex) ); StringList.AddObject(ComboBox2.Text+ '=' + Char(39) + Edit2.Text + Char(39) , TObject(ComboBox2.ItemIndex) ); StringList.AddObject(ComboBox3.Text+ '=' + Char(39) + Edit3.Text + Char(39) , TObject(ComboBox3.ItemIndex) ); StringList.AddObject(ComboBox4.Text+ '=' + Char(39) + Edit4.Text + Char(39) , TObject(ComboBox4.ItemIndex) ); StringList.Sort; Result := StringList[0]; C1 := ''; B := False; for I:=1 to StringList.Count - 1 do begin if Integer(StringList.Objects[I-1]) = Integer(StringList.Objects[I]) then begin C1 := ' or '; end else begin C1 := ') and ('; B := True; end; Result := Result + C1 + StringList[I] end; if B = True then Result := '(' + Result + ')'; StringList.Free;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.