unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TShared = record
Keys:array [0..5] of String;
end;
PShared = ^TShared;
var
Form1: TForm1;
Shared: PShared;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
Shared^.Keys[0]:='windows xp';
Shared^.Keys[1]:='windows 2000';
Shared^.Keys[2]:='windows 7';
Shared^.Keys[3]:='windows 98';
Shared^.Keys[4]:='windows 2003';
Shared^.Keys[5]:='windows server 10';
end;end.click提示出错,但编译通过,错在哪?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TShared = record
Keys:array [0..5] of String;
end;
PShared = ^TShared;
var
Form1: TForm1;
Shared: PShared;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
Shared^.Keys[0]:='windows xp';
Shared^.Keys[1]:='windows 2000';
Shared^.Keys[2]:='windows 7';
Shared^.Keys[3]:='windows 98';
Shared^.Keys[4]:='windows 2003';
Shared^.Keys[5]:='windows server 10';
end;end.click提示出错,但编译通过,错在哪?
解决方案 »
- TTcpServer 产生的 ClientSocket 怎么回复不了客户端信息,客户端的OnReceive事件没有触发!
- 怎么让windows media player9(WMPLib_TLB.pas)控件支持vob文件播放
- 在这个地方问问?
- 几个问题请教,对高手来说很容易的了
- 如何把word文档存入数据库???
- StringGrid的问题,请高手解答。(300分)
- Delphi 怎样调用其他工具实现的Web Services服务(如MS.net)?
- 请问:如何将限定输入数字的EDIT做成一个控件???
- 菜鸟一问:如何编写数据备份的程序?(友情赠送10分)
- 在DEIPHI中如何调用WORD打开WORD文档
- 问一个指针的释放的问题
- PE的引入模块~~
前面用new(Shared),后面记得释放
begin
new(Shared);
end;procedure TForm1.FormDestroy(Sender: TObject);
begin
dispose(Shared);
end;
dispose(shared)
procedure TForm1.Button1Click(Sender: TObject);
begin
New(Shared);
Shared^.Keys[0]:='windows xp';
Shared^.Keys[1]:='windows 2000';
Shared^.Keys[2]:='windows 7';
Shared^.Keys[3]:='windows 98';
Shared^.Keys[4]:='windows 2003';
Shared^.Keys[5]:='windows server 10';
Dispose(Shared);
end;