老是没加几行就出下面的错误,为什么啊?EoutOfResources with message RichEdit line insertion error
解决方案 »
- Delphi 2006 功能强大,还是VS.NET 2005功能强大 如果说VS的话,DELPHI 2006到底落后多少?
- tdxTreeList v4.0 for D7的哪里下载...
- 我用AdoQuery.ExecSQL执行SQL语句,删除ACCESS表里的记录,为什么奇慢无比?如何提高速率?
- REPORT BUILDER能不能继续前一次的打印继续打印,不换页的,如何做呀?多谢
- 各位大侠帮帮忙-TDBChart方面的问题
- 请教高手,用delphi开发的程序怎样做加密?
- 我的ehlib问题??在线及等!!!!!
- Delphi中关于gzip流解压缩的问题。。。
- 简单的问题:怎样将‘2001-10-12’变成‘2001-11-12’*******40分********
- 关于 byte 和 string 数据类型的转换我总是搞不清 我查阅以前的讨论,好多人搞错了
- 打印dxflowchart的图
- 如何得到和修改本机IP?谢谢
unit First;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, ComCtrls,CustomizeDlg, ShellCtrls, ExtCtrls,richedit;type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
RichEdit1: TRichEdit;
RichEdit2: TRichEdit;
procedure FormCreate(Sender: TObject);
//procedure HighlightText(Obj: TRichEdit; Row, Col, Len: Integer);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject); private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
Vt: array [1..8] of String;
Expre: array [1..12] of String;
i:integer;
const
compute: array [1..16,1..3]of integer=((7,11,3),(7,12,4),(6,9,1),(6,10,2),(5,7,5),(5,8,7),(4,5,3),(4,5,4),(4,6,8),(3,4,5),(3,4,7),(2,2,1),(2,2,2),(2,3,8),(1,1,5),(1,1,7));
Vn: array [1..7] of String=('E','E’','T','T’','F','A','M');
implementation
uses finish,prematrix, ExpretoPic;
{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);begin
RichEdit2.clear;
RichEdit1.Clear;
RichEdit2.Lines.Add(' First集');
RichEdit2.Lines.Add('');
RichEdit2.Lines.Add('E→TE′ { ');
RichEdit2.Lines.Add('');
RichEdit2.Lines.Add('E′ →ATE′ | ε { ');
RichEdit2.Lines.Add('');
RichEdit2.Lines.Add('T→FT′ { ');
RichEdit2.Lines.Add('');
RichEdit2.Lines.Add('T′ → MFT′ | ε { ');
RichEdit2.Lines.Add('');
RichEdit2.Lines.Add('F→ (E) ∣i { ');
RichEdit2.Lines.Add('');
RichEdit2.Lines.Add('A→+|- { ');
RichEdit2.Lines.Add('');
RichEdit2.Lines.Add('M→*|/ { ');
Expre[1]:='E→TE′';
Expre[2]:='E′ →ATE′';
Expre[3]:='E′ →ε';
Expre[4]:='T→FT′';
Expre[5]:='T′ → MFT′';
Expre[6]:='T′ →ε';
Expre[7]:='F→ (E) ';
Expre[8]:='F→i';
Expre[9]:='A→+';
Expre[10]:='A→-';
Expre[11]:='M→*';
Expre[12]:='M→/';
Vt[1]:='+';
Vt[2]:='-';
Vt[3]:='*';
Vt[4]:='/';
Vt[5]:='(';
Vt[6]:=')';
Vt[7]:='i';
Vt[8]:='e'; i:=1;
end;
procedure HighlightText(Obj: TRichEdit; Row, Col, Len: Integer);
var
Fmt: TCharFormat2;
n: Integer;
begin
Obj.SetFocus;
n := SendMessage(Obj.Handle, EM_LINEINDEX, Row, 0) + Col;
Obj.SelStart := n;
Obj.SelLength := Len; // 选中要高亮显示的文字
Fmt.cbSize := sizeof(Fmt);
Fmt.dwMask := CFM_COLOR or CFM_BACKCOLOR;
SendMessage(Obj.Handle, EM_GETCHARFORMAT, SCF_SELECTION, Integer(@Fmt)); // 获取文本信息
Fmt.crTextColor := not Fmt.crTextColor and $FFFFFF; // 颜色取反
Fmt.crBackColor := not Fmt.crBackColor and $FFFFFF; // 背景色取反
SendMessage(Obj.Handle, EM_SETCHARFORMAT, SCF_SELECTION, Integer(@Fmt)); // 设置
//Obj.SelLength := 0; // 取消选中文本
end;
procedure TForm1.Button1Click(Sender: TObject);
var
pos,r:integer;
temp:string;
begin
if(i<=16 ) then
begin RichEdit1.Lines.Add('利用规则:'+Expre[compute[i,2]]);
RichEdit1.Lines.Add('First('+Vn[compute[i,1]]+')增加'+Vt[compute[i,3]]); for r:=0 to compute[i,1]*2-1 do
pos :=pos+ length(RichEdit2.Lines.Strings[r]) + 2;
RichEdit2.selstart :=pos-2;
RichEdit2.SetFocus; temp:=RichEdit2.Lines.Strings[r]+' '+Vt[compute[i,3]]+',';
RichEdit2.Lines.Delete(r);
RichEdit2.Lines.Insert(r,temp);
RichEdit2.Font.Color:=clred;
i:=i+1; HighlightText(RichEdit2,0,5,2);
end
else
form2.showmodal;
end;procedure TForm1.Button3Click(Sender: TObject);
begin
form4.showmodal;
end;end.