很复杂的问题

flyingworm 2003-04-22 06:30:45
那位大侠给讲讲delphi里边关于定义变量、声明和继承类的具体方法?
...全文
30 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
crapex 2003-04-22
  • 打赏
  • 举报
回复
全局变量可以在文件头的private或者public里面声明,可以这么写:
private
aaa:string;
public
i:integer;
要在别的窗体里引用变量,可以使用
Form1.i:=1;类似的写法。
flyingworm 2003-04-22
  • 打赏
  • 举报
回复
谢了
qwertyasd 2003-04-22
  • 打赏
  • 举报
回复
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
dd:string//全局变量
flyingworm 2003-04-22
  • 打赏
  • 举报
回复
全局变量呢?
qwertyasd 2003-04-22
  • 打赏
  • 举报
回复
定义变量
var dd:string;
定义类
TTitle = class(tpersistent)
private
fPrint:boolean;
fText:tstrings;
fFont:tfont;
fAlignment:talignment;
ftop:integer;
fRowspace:integer;
fEveryPage:boolean;
procedure SetText(value:tstrings);
procedure SetFont(value:tfont);
published
property Print:boolean read fprint write fprint ;
property Text:tstrings read fText write settext;
property Font: TFont read fFont write SetFont;
property Top:integer read ftop write ftop;
property Alignment:talignment read fAlignment write fAlignment;
property Rowspace:integer read fRowspace write fRowspace;
property EveryPage:boolean read fEveryPage write fEveryPage;
end;

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧