|
|
Регистрация Восстановить пароль |
Повторная активизация e-mail |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
|
Опции темы | Поиск в этой теме |
06.10.2010, 20:25 | #1 |
Регистрация: 19.09.2010
Сообщений: 7
|
Написал прогу на делфях 7-х, а она у меня на делфях 2010 неидет
unit Unit1;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls; type TForm1 = class(TForm) GroupBox1: TGroupBox; ListBox1: TListBox; Button1: TButton; Edit3: TEdit; Button3: TButton; Edit1: TEdit; Label1: TLabel; GroupBox2: TGroupBox; ListBox2: TListBox; Edit4: TEdit; UpDown1: TUpDown; Button2: TButton; Label2: TLabel; procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; ResultA:array [1..5000] of string[50]; Invert:boolean; implementation function FindRule(F:char):string; var i:integer; R:string[15]; begin R:=''; for i:=0 to Form1.ListBox1.Count-1 do if Form1.ListBox1.Items.ValueFromIndex[i][1]=F then if Invert then R:=R+inttostr(i) else R:=inttostr(i)+R; if length(R)>1 then Invert:=not Invert; FindRule:=R end; function UseRule(Num:string):string; begin UseRule:=copy(Form1.ListBox1.Items. ValueFromIndex[strtoint(Num)],4,100); end; function FindResult(Str:string; size:integer):boolean; var i:integer; begin FindResult:=true; for i:=1 to size do if (ResultA[i]=Str) or (length(Str)>(strtoint(Form1.Edit4. Text))) then begin FindResult:=false; break; end; end; function NotTerminal(str:string):boolean; var i,j,num:integer; terminal:array [1..100] of char; ResultNT:boolean; begin num:=1 ; for i:=1 to length(Form1.Edit3.Text) do if Form1.Edit3.Text[i]<>' ' then begin terminal[num]:=Form1.Edit3.Text[i]; inc(num); end; dec(num); for i:=1 to length(str) do begin for j:=1 to num do begin if str[i]<>terminal[j] then ResultNT:=false else begin ResultNT:=true; break; end; end; if not ResultNT then break; end; NotTerminal:=ResultNT; end; procedure TForm1.Button2Click(Sender: TObject); var NumOfRule,TmpResult,MBResult:string ; i,n,j,size,posit,tmp:integer; flag:boolean; begin invert:=false; flag:=false; for i:=1 to 5000 do ResultA[i]:=''; Form1.ListBox2.Clear; size:=1; NumOfRule:=FindRule('S'); for i:=1 to length(NumOfRule) do begin ResultA[size]:=UseRule(NumOfRule[i]); end; ResultA[size]:='S'; posit:=0; j:=1; repeat if posit>strtoint(Edit4.Text) then begin posit:=0; tmp:=size; end; posit:=posit+1; j:=size; for n:=1 to j do begin TmpResult:=ResultA[n]; NumOfRule:=FindRule(ResultA[n][posit]); for i:=1 to length(NumOfRule) do begin MBResult:=TmpResult; delete(MBResult,posit,1); insert(UseRule(NumOfRule[i]),MBResult,posit); if FindResult(MBResult,size) then begin inc(size); ResultA[size]:=MBResult; end; end; end; until tmp=size; for i:=1 to size do //Form1.ListBox2.Items.Add(ResultA[i]); if NotTerminal(ResultA[i]) and (length(ResultA[i])<=strtoint(Edit4.Text)) then Form1.ListBox2.Items.Add(ResultA[i]); //showmessage(inttostr(size)); end; procedure TForm1.Button3Click(Sender: TObject); begin Form1.ListBox1.Items.Delete(Form1.L istBox1.ItemIndex); Form1.ListBox1.ItemIndex:=0; end; procedure TForm1.Button1Click(Sender: TObject); begin if (Length(Form1.Edit1.Text)>=3) and not NotTerminal(Form1.Edit1.Text[1]) and (Form1.Edit1.Text[2]='-') and (Form1.Edit1.Text[3]='>') then begin Form1.ListBox1.Items.Add(' '+Form1.Edit1.Text); Form1.Edit1.Clear; end else ShowMessage('Правило невено!'); end; end. Выдает 2-е ошибки немогу исправить |
06.10.2010, 20:39 | #2 |
Пользователь
Регистрация: 02.11.2008
Сообщений: 75
|
Ты издеваешься? Хотя бы текст ошибок выложи.
«Когда ты действительно чего-то хочешь, вся Вселенная помогает тебе осуществить твою мечту».(с) Пауло Коэльо
|
06.10.2010, 20:41 | #3 |
Регистрация: 19.09.2010
Сообщений: 7
|
текст ошибок
Checking project dependencies... Compiling Project1.dproj (Debug configuration) [DCC Warning] Unit1.pas(48): W1057 Implicit string cast from 'ShortString' to 'string' [DCC Warning] Unit1.pas(48): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString' [DCC Warning] Unit1.pas(48): W1057 Implicit string cast from 'ShortString' to 'string' [DCC Warning] Unit1.pas(48): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString' [DCC Warning] Unit1.pas(51): W1057 Implicit string cast from 'ShortString' to 'string' [DCC Warning] Unit1.pas(63): W1057 Implicit string cast from 'ShortString' to 'string' [DCC Warning] Unit1.pas(89): W1036 Variable 'ResultNT' might not have been initialized [DCC Warning] Unit1.pas(106): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString' [DCC Warning] Unit1.pas(117): W1057 Implicit string cast from 'ShortString' to 'string' [DCC Error] Unit1.pas(118): E2010 Incompatible types: 'Char' and 'AnsiChar' [DCC Warning] Unit1.pas(127): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString' [DCC Warning] Unit1.pas(133): W1057 Implicit string cast from 'ShortString' to 'string' [DCC Warning] Unit1.pas(134): W1057 Implicit string cast from 'ShortString' to 'string' [DCC Fatal Error] Project1.dpr(5): F2063 Could not compile used unit 'Unit1.pas' Failed Elapsed time: 00:00:00.4 |
Похожие темы | ||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
Системный администратор в делфях | vrmc | Помощь студентам | 0 | 18.05.2010 07:46 |
Написал прогу! немного не то считает! | santi90 | Компоненты Delphi | 2 | 23.03.2010 18:42 |
Тест на делфях | kidman | Фриланс | 8 | 27.05.2009 08:13 |
Написал прогу в паскале... | deu4er | Помощь студентам | 2 | 19.11.2008 20:08 |
Ассемблер в Делфях | Roof | Помощь студентам | 8 | 22.07.2007 11:58 |