我在单元中定义个数组变量,报错呀,是什么原因?谢谢。
unit1.pas如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
viewstring:string;
i:integer;
rbuf,sbuf:array[16] of byte; //编绎时这条通不过。
implementation
{$R *.dfm}
end.
*****************************************
错误提示为:
[Error] Unit1.pas(23): '.. ' expected but '] ' found
[Error] Unit1.pas(26): Constant expression expected
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas '
请问高手,这该怎么办呀?是什么原因,
先谢了。
[解决办法]
rbuf,sbuf:array[0..15] of byte; //编绎时这条通不过。
[解决办法]
var
rbuf,sbuf:array[0..15] of byte;