Вниз
Скачать: CL | DM;

Логические выражения   Найти похожие ветки 

 
DL   (2009-03-09 15:38) [0]

Имеется список (TStrings) вида:


A or (B and C)
(B and A) and C
C and A or B


Можно ли как нибудь получить результат вычисления для каждой строки


 
Palladin ©   (2009-03-09 15:39) [1]

Да. Нужно как нибудь написать код вычисления для каждой строки.


 
{RASkov} ©   (2009-03-09 16:45) [2]

unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;

type
 TForm1 = class(TForm)
   ListBox1: TListBox;
   procedure FormCreate(Sender: TObject);
   procedure ListBox1Data(Control: TWinControl; Index: Integer; var Data: String);
 private { Private declarations }
 public  { Public declarations }
   A, B, C: Boolean;
 end;

var Form1: TForm1;

implementation
{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
 A:=False; B:=True; C:=True;
 ListBox1.Style:=lbVirtual;
 ListBox1.Count:=3;
 ListBox1.OnData:=ListBox1Data;
end;

procedure TForm1.ListBox1Data(Control: TWinControl; Index: Integer; var Data: String);
begin
 case Index of
  0: Data:=BoolToStr(A or (B and C), True);
  1: Data:=BoolToStr((B and A) and C, True);
  2: Data:=BoolToStr(C and A or B, True);
 end;
end;

end.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.012 c
2-1236668653
petvv
2009-03-10 10:04
2009.04.26
Текст с разделителями.


15-1235409163
Кое кто
2009-02-23 20:12
2009.04.26
Аналог lib.ru


15-1235729427
Галинка
2009-02-27 13:10
2009.04.26
SAX или DOM


2-1236623891
programmer90
2009-03-09 21:38
2009.04.26
AnsiToOem, CharToOem


2-1236599989
KillaTank
2009-03-09 14:59
2009.04.26
Поиск по DBF




   Наверх