unit PRODPERIOD2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, LDFORM, PrnDbgeh, DB, ADODB, ActnList, ImgList, ComCtrls,
ExtCtrls, GridsEh, DBGridEh, ToolWin;
type
TFM_PRODPERIOD2 = class(TLDFROM)
DBGridEh2: TDBGridEh;
Panel1: TPanel;
Animate2: TAnimate;
ADOTMP: TADOQuery;
ADOQuery1: TADOQuery;
ADOQuery3: TADOQuery;
DataSource1: TDataSource;
ActionList2: TActionList;
ADOQuery4: TADOQuery;
procedure ToolButton5Click(Sender: TObject);
procedure dOneBeforeOpen(DataSet: TDataSet);
procedure dOneAfterOpen(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FM_PRODPERIOD2: TFM_PRODPERIOD2;
implementation
USES DATA;
{$R *.dfm}
procedure TFM_PRODPERIOD2.ToolButton5Click(Sender: TObject);
var
s_time:TDateTime;
e_time:TDateTime;
dept_ptr:String;
numberPlies:String;
ttype:String;
begin
s_time:= Date -15;
e_time:= Date;
with ADOQuery1 do
begin
if DBGridEh2.Columns[DBGridEh2.SelectedIndex].FieldName='dept_ptr' then
ttype:=1//明細
numberPlies: DBGridEh1.datasource.dataset.FieldByName('層數').value;
begin
close;
sql.Clear;
sql.Add('execute Wang_dept_prodtime '+quotedstr(s_time)+','+quotedstr(e_time)+','+quotedstr(dept_ptr)+','+quotedstr(層數)+','+quotedstr(ttype)' ) ;
end;
else
begin
ttype:=2;//匯總
close;
sql.Clear;
sql.Add('execute Wang_dept_prodtime '+quotedstr(s_time)+','+quotedstr(e_time)+','+quotedstr(dept_ptr)+','+quotedstr(層數)+','+quotedstr(ttype)' ) ;
end;
end.
除錯彈出的提示!!!Error
------------------------------------------------------------------------------------------------------------------
[Error] PRODPERIOD2.pas(62): Missing operator or semicolon
[Error] PRODPERIOD2.pas(64): Illegal character in input file: '}' ($7D)
[Error] PRODPERIOD2.pas(65): Incompatible types: 'String' and 'TDateTime'
[Error] PRODPERIOD2.pas(65): Incompatible types: 'String' and 'TDateTime'
[Error] PRODPERIOD2.pas(68): Expression expected but 'END' found
[Error] PRODPERIOD2.pas(69): ';' not allowed before 'ELSE'
[Error] PRODPERIOD2.pas(71): Incompatible types: 'String' and 'Integer'
[Error] PRODPERIOD2.pas(73): Undeclared identifier: 'sql'
[Error] PRODPERIOD2.pas(74): Missing operator or semicolon
[Error] PRODPERIOD2.pas(74): Incompatible types: 'String' and 'TDateTime'
[Error] PRODPERIOD2.pas(74): Incompatible types: 'String' and 'TDateTime'
[Error] PRODPERIOD2.pas(74): Illegal character in input file: '層' ($B2E3)
[Error] PRODPERIOD2.pas(74): Unterminated string
[Error] PRODPERIOD2.pas(78): ';' expected but '.' found
[Error] PRODPERIOD2.pas(160): Declaration expected but end of file found
[Error] PRODPERIOD2.pas(23): Unsatisfied forward or external declaration: 'TFM_PRODPERIOD2.dOneBeforeOpen'
[Error] PRODPERIOD2.pas(24): Unsatisfied forward or external declaration: 'TFM_PRODPERIOD2.dOneAfterOpen'
[Fatal Error] data.pas(334): Could not compile used unit 'PRODPERIOD2.pas'
uj5u.com熱心網友回復:
if xxx thenbegin
....
end //沒分號
else
begin
end;
if xxx then
do_something //沒分號
else
do_otherthing;
58行那個else明顯錯了。
uj5u.com熱心網友回復:
LZ代碼好亂。我找到的錯誤:1、else前不要分號;
2、第一個 if ....then 后的ttype后少了分號;
3、后面的numberPlies賦值少=號。
都是一些細節問題
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/64668.html
標籤:語言基礎/算法/系統設計
