困惑,¥¥¥¥¥¥¥¥¥¥¥¥不能理解,请各位说说
我学程序有一段时间了,可是觉得怎么一点长进都没有
我看了DELPHI开发者手册开始,抄写了一段代码
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
procedure WhatHaveIGot(A: array of const);
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WhatHaveIGot(A: array of const);
var
i:integer;
typestr:string;
begin
for i := low(a) to high(a) do
begin
case a[i].VType of
vtinteger : typestr:='Integer';
vtBoolean : typestr:='Boolean';
vtChar : typestr:='char';
vtExtended : typestr:='Extended';
vtString : typestr:='String';
vtPointer : typestr:='Pointer';
vtPChar : typestr:='pchar';
vtObject : typestr:='Object';
vtWideChar : typestr:='WideChar';
vtPWideChar : typestr:='PWideChar';
vtAnsiString: typestr:='AnsiString';
vtCurrency : typestr:='Currency';
vtVariant : typestr:='Variant';
vtInterface : typestr:='Interface';
vtWideString: typestr:='WideString';
vtInt64 : typestr:='Int64';
end;
ShowMessage(Format('Array item %d is a%s',[i,TypeStr]));
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
WhatHaveIGot();
end;
end.
我想用BUTTON来看这个ShowMessage(Format('Array item %d is a%s',[i,TypeStr]));
,但是不知道WhatHaveIGot();挎号里面该写什么
还有,我对于函数真的是一翘不同,我看书上说过程和函数就是一个返回值问题,但是真的不知道函数怎么用,过程我知道怎么用,但是函数真的是不知道从什么去理解,发我抄的这个发上,希望各位跟我提点函数怎么用[比如我知道这个函数的功能,但是不知道怎么去里面写代码去实现我想要的],有什么方法能让我[前提是知道这个函数有什么功能,没有用过,但是我想在里面写代码,先不说能实现什么功能],最起码不会提示我乱输入啊