delphi dasturlash tilida grafik interfeys tuzilmasi

DOCX 8 sahifa 24,5 KB Bepul yuklash

Sahifa ko'rinishi (5 sahifa)

Pastga aylantiring 👇
1 / 8
procedure tform1.button20click(sender: tobject); var n1,m1,n2,m2,i,j:integer; begin n1:=stringgrid1.rowcount; m1:=stringgrid1.colcount; n2:=stringgrid1.rowcount; m2:=stringgrid1.colcount; for i:=0 to n1 do for j:=0 to m1 do stringgrid1.cells[j,i]:=''; for i:=0 to stringgrid2.rowcount do for j:=0 to stringgrid2.colcount do stringgrid2.cells[j,i]:=''; edit1.text:=''; edit2.text:='boshlanmadi'; end; procedure tform1.button19click(sender: tobject); label 1; var s,uzg,tab1,tab2,amal:array[1..50]of string; a,f,alif:string; n,i,j,k,k1,m,jj,j1,num,numm,numforst,numforst1,uzgnum:integer; bracketcount,sqbracketcount:smallint; input,satr,stek,stekk,st,st1,kk:string; bol, boll,ff:boolean; begin bol:=true; boll:=true; input:=edit1.text; bracketcount:=0; sqbracketcount:=0; for i:=1 to length(input) do case input[i] of '(': inc(bracketcount); ')': dec(bracketcount); '[': inc(sqbracketcount); ']': dec(sqbracketcount); end; if length(input)>2 then begin if (bracketcount)<>0 then begin edit2.text:='aylana qavslar sonida xatolik bor'; goto 1; // expressiontest:='e'; end ; if (sqbracketcount)<>0 then begin edit2.text:='kvadrat qavslar sonida xatolik bor'; goto 1; // expressiontest:='e'; end; end else begin edit2.text:='bo`sh satr'; goto 1; //expressiontest:='e'; end; //amallarni ajratish a:=input; n:=length(a); f:=''; k:=0; for i:=2 to n-1 do begin if (a[i-1]+a[i]='or') then begin k:=k+1; s[k]:='or'; a[i-1]:='4'; a[i]:=' '; end; if (a[i-1]='!') then begin k:=k+1; s[k]:='!'; a[i-1]:='2'; end; if (a[i]='|') then begin k:=k+1; s[k]:='|'; …
2 / 8
[3]:='and'; s[4]:='or'; s[5]:='->'; s[6]:=' '; s[7]:='+'; s[8]:='|'; s[9]:='na'; //------o`zgaruvchilarni ajratish alif:='abcdefghijklmnopqrst'; i:=1; k:=0; while i ']' do begin uzg[k]:=concat(uzg[k],a[i]); a[i]:=' '; i:=i+1; end; uzg[k]:=concat(uzg[k],a[i]); a[i]:=alif[k]; end; i:=i+1; end; uzgnum:=k; //------shifrlangan satrdagi probellarni yuqotish; k:=0; for i:=1 to n do if a[i]<>' ' then begin k:=k+1; a[k]:=a[i]; end; delete(a,k+1,n-k); //-------poliskiy zapis algoritmi; satr:=''; m:=1; n:=length(a); stek:='+'; for i:=1 to n do begin if (a[i]<>'(') and (a[i]<>')') and(a[i]<>'2') and(a[i]<>'3') and (a[i]<>'4') and(a[i]<>'5') and(a[i]<>'6') and(a[i]<>'7') and(a[i]<>'8')and (a[i]<>'9') then satr:=concat(satr,a[i]) else begin if (a[i]='(') then begin m:=m+1; stek:=concat(stek,a[i]); end; if (a[i]='2') then begin stek:=stek+a[i]; m:=m+1; end; if a[i]=')' then begin while stek[m]<>'(' do begin satr:=concat(satr,stek[m]); delete(stek,m,1); m:=m-1; end; if stek[m]='(' then begin delete(stek,m,1); m:=m-1; end; end; if a[i]='3' then begin if (stek[m]='2') then begin satr:=satr+stek[m];delete(stek,m,1); m:=m-1; end; if (stek[m]='3') then begin satr:=satr+stek[m]; stek[m]:='3'; end else begin stek:=stek+a[i]; m:=m+1; end; end; if a[i]='4' then begin if (stek[m]='2') then begin satr:=satr+stek[m];delete(stek,m,1); m:=m-1; end; if (stek[m]='3')or (stek[m]='4') …
3 / 8
or (satr[i]='4') or (satr[i]='5') or (satr[i]='6') or (satr[i]='7') or (satr[i]='8')or (satr[i]='9') then begin num:=num+1; kk:=inttostr(num); k:=1; while k =1) and (bol) do if satr[i-1]=inttostr(numforst) then begin st:=inttostr(numforst); bol:=false; end else numforst:=numforst-1; numforst1:=num; if boll then while (numforst1>=1) and (boll) do if satr[i-2]=inttostr(numforst1) then begin st1:=inttostr(numforst1); boll:=false; end else numforst1:=numforst1-1; bol:=true; boll:=true; stringgrid1.cells[0,jj]:=kk+' = '+st1+s[strtoint(satr[i])]+st; tab1[num]:=st1; tab2[num]:=st; amal[num]:=satr[i]; jj:=jj+1; delete(satr,i-2,3); insert(inttostr(num),satr,i-2); st:=''; st1:=''; i:=i-1; n:=n-2; end else i:=i+1; end; //-----chinlik jadvalini tuzish for i:=1 to uzgnum-1 do for j:=i+1 to uzgnum do if uzg[i]=uzg[j] then uzg[j]:=' '; //bir xil uzgaruvchilarni yuqotish; j:=0; for i:=1 to uzgnum do if uzg[i]<>' ' then begin j:=j+1; stringgrid2.cells[j,0]:=uzg[i]; end; for i:=j+1 to j+num+1 do stringgrid2.cells[i,0]:=inttostr(i-j); n:= round(exp(j*ln(2))); stringgrid2.colcount:=j+num+1; //jadval ichini tuldirish j1:=0; for i:=1 to j do if (uzg[i]='[1]') or (uzg[i]='[0]') then j1:=j1+1; m:=j; j:=j-j1; n:= round(exp(j*ln(2))); stringgrid2.rowcount:=n+1; for i:=1 to n do stringgrid2.cells[0,i]:=inttostr(i); for i:=1 to m do begin k:=round(exp(j*ln(2))/(2*i)); k1:=0; ff:=true; if stringgrid2.cells[i,0]='[1]' …
4 / 8
egin if amal[i-m]='2' then if stringgrid2.cells[k,jj]='0' then stringgrid2.cells[i,jj]:='1' else stringgrid2.cells[i,jj]:='0'; if amal[i-m]='3' then if (stringgrid2.cells[k,jj]='1') and (stringgrid2.cells[k1,jj]='1') then stringgrid2.cells[i,jj]:='1' else stringgrid2.cells[i,jj]:='0'; if amal[i-m]='4' then if (stringgrid2.cells[k,jj]='0') and (stringgrid2.cells[k1,jj]='0') then stringgrid2.cells[i,jj]:='0' else stringgrid2.cells[i,jj]:='1'; if amal[i-m]='5' then if (stringgrid2.cells[k1,jj]='1') and (stringgrid2.cells[k,jj]='0') then stringgrid2.cells[i,jj]:='0' else stringgrid2.cells[i,jj]:='1'; if amal[i-m]='6' then if stringgrid2.cells[k,jj]=stringgrid2.cells[k1,jj] then stringgrid2.cells[i,jj]:='1' else stringgrid2.cells[i,jj]:='0'; if amal[i-m]='7' then if stringgrid2.cells[k,jj]<>stringgrid2.cells[k1,jj] then stringgrid2.cells[i,jj]:='1' else stringgrid2.cells[i,jj]:='0'; if amal[i-m]='8' then if (stringgrid2.cells[k,jj]='1') and (stringgrid2.cells[k1,jj]='1') then stringgrid2.cells[i,jj]:='0' else stringgrid2.cells[i,jj]:='1'; if amal[i-m]='9' then if (stringgrid2.cells[k,jj]='0') and (stringgrid2.cells[k1,jj]='0') then stringgrid2.cells[i,jj]:='1' else stringgrid2.cells[i,jj]:='0'; end; end; edit2.text:='hisoblash tugadi'; 1: end; procedure tform1.button21click(sender: tobject); var input:string; n:integer; begin input:=edit1.text; n:=length(input); delete(input,n,1); edit1.text:=input; end; end.
5 / 8
delphi dasturlash tilida grafik interfeys tuzilmasi - Page 5

Ko'proq o'qimoqchimisiz?

Barcha 8 sahifani Telegram orqali bepul yuklab oling.

To'liq faylni yuklab olish

"delphi dasturlash tilida grafik interfeys tuzilmasi" haqida

procedure tform1.button20click(sender: tobject); var n1,m1,n2,m2,i,j:integer; begin n1:=stringgrid1.rowcount; m1:=stringgrid1.colcount; n2:=stringgrid1.rowcount; m2:=stringgrid1.colcount; for i:=0 to n1 do for j:=0 to m1 do stringgrid1.cells[j,i]:=''; for i:=0 to stringgrid2.rowcount do for j:=0 to stringgrid2.colcount do stringgrid2.cells[j,i]:=''; edit1.text:=''; edit2.text:='boshlanmadi'; end; procedure tform1.button19click(sender: tobject); label 1; var s,uzg,tab1,tab2,amal:array[1..50]of string; a,f,alif:string; n,i,j,k,k1,m,jj,j1,num,numm,numforst,numforst1,uzgnum:integer; bracketcount,sqbracketcount:smallint; input,satr,stek,stekk,st,st1,kk:string; bol, boll,ff:boolean; begin bol:=true; boll:=true; input:=edit1.text; bracketcount:=0; sqbracketcount:=0; for i:=1 to length(input) do c...

Bu fayl DOCX formatida 8 sahifadan iborat (24,5 KB). "delphi dasturlash tilida grafik interfeys tuzilmasi"ni yuklab olish uchun chap tomondagi Telegram tugmasini bosing.

Teglar: delphi dasturlash tilida grafik… DOCX 8 sahifa Bepul yuklash Telegram