sorry ,没写清楚 原程序是这样的: 定义好 Ball:Array[1..13]of byte; 之后,用如下方法赋值 for n:=1 to 13 do begin Ball[n]:=0; Showmessage('the answer is '+char(Ball[n]));end; 结果数组仍为空,这是为什么?
for n :=Low(temp) to High(temp) do begin temp[n]:=0; Showmessage('the number is '+inttostr(temp[n]));end;
n := 0 ; for Low(temp) to High(temp) do begin n := n+1 ; temp[n]:=46; Showmessage('the number is '+char(temp[n]));end;
for n :=Low(temp) to High(temp) do begin temp[n]:=45; Showmessage('the number is '+inttostr(temp[n]));end; char(0)本身就看不见
多谢各位大哥,再多问一句inttostr和直接用char()转换类型不一样麽?分数我先给了吧。
先确定数组已经存在初值。 procedure TForm1.Button1Click(Sender: TObject); var n:Integer; begin for n:=1 to 13 do begin ball[n]:=n; Showmessage('the answer is '+Inttostr(Ball[n])); end;
原程序是这样的:
定义好
Ball:Array[1..13]of byte;
之后,用如下方法赋值
for n:=1 to 13 do
begin
Ball[n]:=0;
Showmessage('the answer is '+char(Ball[n]));end;
结果数组仍为空,这是为什么?
begin
temp[n]:=0;
Showmessage('the number is '+inttostr(temp[n]));end;
for Low(temp) to High(temp) do
begin
n := n+1 ;
temp[n]:=46;
Showmessage('the number is '+char(temp[n]));end;
begin
temp[n]:=45;
Showmessage('the number is '+inttostr(temp[n]));end;
char(0)本身就看不见
procedure TForm1.Button1Click(Sender: TObject);
var
n:Integer;
begin
for n:=1 to 13 do
begin
ball[n]:=n;
Showmessage('the answer is '+Inttostr(Ball[n]));
end;
char 和ord相反