Показать сообщение отдельно
  #6  
Старый 05.02.2010, 14:20
unmazable unmazable вне форума
Прохожий
 
Регистрация: 05.02.2010
Сообщения: 10
Репутация: 10
По умолчанию

у меня есть программка , в ней формируется код примерно такой
Код:
library 
aaaa;
uses
ShareMem,Windows, SysUtils, Classes, Forms,Dialogs,
 forma in 'forma.pas' {LAforma};
type   TAutoState =(
AUTO_H, AUTO_S1, AUTO_S2, AUTO_E);
{$R *.res}
function ShowForm(stroka: string) : Integer;
var Form : TLAforma;
dl,i,j,fl,zn,ind:integer;
st,str,sInput:Shortstring;
iState:TAutoState;
begin 
Form := TLAforma.Create(Application);
with Form do begin
for i:=0 to 2 do
for j:=1 to StringGrid1.RowCount-1 do StringGrid1.Cells[i,j]:=' ';
StringGrid1.Cells[0,0]:='№';
 StringGrid1.Cells[1,0]:='Значение';
StringGrid1.Cells[2,0]:='Лексема';
ind:=1; sInput:=stroka;
Edit2.Text:=sInput;
sInput:=sInput+' ';
dl:=Length(sInput);
iState:=AUTO_H;
fl:=0;zn:=0;
for j:=1 to dl do begin st:=sInput[j];
case iState of
AUTO_H: case sInput[j] of
'-','0'..'9': begin iState:=AUTO_H;str:=str+st; end;
'/': begin iState:=AUTO_S1;fl:=1;zn:=1;end; 
else begin iState:= AUTO_E;str:=str+st; end;end; 
AUTO_S1: case sInput[j] of
'-','0'..'9': begin iState:=AUTO_S1;str:=str+st; end;
':': begin iState:=AUTO_S2;fl:=1;zn:=2;end; 
else begin iState:= AUTO_E;str:=str+st; end;end; 
AUTO_S2: case sInput[j] of
'-','0'..'9': begin iState:=AUTO_S2;str:=str+st; end;
'*': begin iState:=AUTO_H;fl:=1;zn:=3;end; 
else begin iState:= AUTO_E;str:=str+st; end;end; 
AUTO_E: begin
if sInput[j]<>' ' then begin  iState:=AUTO_E;str:=str+st;end
else begin iState:=AUTO_H;
showMessage('Ошибка распознавания: '+str);Memo1.Lines.Add(str);str:='';end;end;end;
if fl=1 then begin StringGrid1.Cells[0,ind]:=IntToStr(ind);
StringGrid1.Cells[1,ind]:=str;
case zn of
1: begin StringGrid1.Cells[2,ind]:='Число'; end;
2: begin StringGrid1.Cells[2,ind]:='Месяц'; end;
3: begin StringGrid1.Cells[2,ind]:='Число'; end;
end;str:='';ind:=ind+1;fl:=0;
if ind=StringGrid1.RowCount then  StringGrid1.RowCount:=StringGrid1.RowCount+1;
end;end;end; Form.StringGrid1.RowCount:=Form.StringGrid1.RowCount-1; Result := Form.ShowModal;Form.Free;end;
exports  ShowForm;
end.
т.е. как у меня сейчас... потом я сам компилирую из этого длл и уже из длл вызываю... хотелось бы как ни будь обоитись без этого пункта...



updated
будет немного изменено это...будут создаваться некоторые компаненты динамически...


updated 2
нашел вот еще что.... paxcompiler
Ответить с цитированием