是否在自定類別的語法錯誤 |
答題得分者是:ccchen
|
T.J.B
版主 發表:29 回覆:532 積分:497 註冊:2002-08-14 發送簡訊給我 |
請教站長及各位學長 此單元介面如程式碼實作完畢後 欲在 onformcreate 事件處理
卻無法開啟 而有 expected':'but '='found 錯誤訊息
是否在自定類別的語法錯誤 另提一點
private { Private declarations } FValue : Double ;
FOperand : TOperandArray ;<--按ctrl-space無法找到此自定類別
FOperandCounts : Byte ;
FOperator : TOperatorArray ;<--按ctrl-space無法找到此自定類別
FOperatorCounts : Byte ;
謝謝 ^^~~~~~~~
單元如下 unit Unit1; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls; type
TForm1 = class(TForm) TOperatorType = ( otNone, otPlus, otMinus, otBy, otDivided, otEqual );
TOperatorArray = array [1..2] of ToperatorType ;
TOperandArray = array [1..3] of Double ; Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
Button18: TButton;
Button19: TButton;
Button20: TButton;
private { Private declarations } FValue : Double ;
FOperand : TOperandArray ;
FOperandCounts : Byte ;
FOperator : TOperatorArray ;
FOperatorCounts : Byte ; procedure Compute( AOperator : TOperatorType ) ;
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} { TForm1 }
回首來時路 也無風雨也無晴~~@.@
------
天行健 君子當自強不息~~@.@ |
ccchen
版主 發表:61 回覆:940 積分:1394 註冊:2002-04-15 發送簡訊給我 |
只有一個錯誤, ToperatorType, TOperatorArray,等type宣告之位置不對.
你把這些type之宣告混到Form Class中了
type TOperatorType = ( otNone, otPlus, otMinus, otBy, otDivided, otEqual ); TOperatorArray = array [1..2] of ToperatorType ; TOperandArray = array [1..3] of Double ; //以下為TForm1 Class之定義 Tform1 = class(TForm) Button1: TButton; OpenDialog1: TOpenDialog; private FValue : Double ; FOperand : TOperandArray ;//<--按ctrl-space無法找到此自定類別 FOperandCounts : Byte ; FOperator : TOperatorArray ;//<--按ctrl-space無法找到此自定類別 FOperatorCounts : Byte ; { Private declarations } public { Public declarations } end; //結束TForm1之定義 |
T.J.B
版主 發表:29 回覆:532 積分:497 註冊:2002-08-14 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |