Home > Back-end >  Delphi code problem
Delphi code problem

Time:09-22

  unit PRODPERIOD2; 

Interface

USES the
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 the DATA;
{$R *. DFM}

Procedure TFM_PRODPERIOD2. ToolButton5Click (Sender: TObject);
Var
S_time: TDateTime;
E_time: TDateTime;
Dept_ptr: String;
NumberPlies: String;
Ttype: String;
The begin
S_time:=the Date to 15;
E_time:=the Date;
With ADOQuery1 do
The begin
If DBGridEh2. Columns [DBGridEh2 SelectedIndex] FieldName='dept_ptr' then
Ttype:=1//detail
NumberPlies: DBGridEh1 datasource. The dataset. FieldByName (' layers'). The value;
The begin
The close;
SQL. The Clear;
Execute SQL. Add (' Wang_dept_prodtime '+ quotedstr (s_time) +', '+ quotedstr (e_time) +', '+ quotedstr (dept_ptr) +', '+ quotedstr (layers) +', '+ quotedstr (ttype)');
end;
The else
The begin
Ttype:=2;//summary
The close;
SQL. The Clear;
Execute SQL. Add (' Wang_dept_prodtime '+ quotedstr (s_time) +', '+ quotedstr (e_time) +', '+ quotedstr (dept_ptr) +', '+ quotedstr (layers) +', '+ quotedstr (ttype)');
end;
End.




Debug the pop-up hint!!!!! The Error
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
[Error] PRODPERIOD2. Pas (62) : Missing operator or semicolon
[Error] PRODPERIOD2. Pas (64) : Illegal character in input file: '} '($7 d)
[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 found 'END'
[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: 'layers' ($B2E3)
[Error] PRODPERIOD2. Pas (74) : Unterminated string
[Error] PRODPERIOD2. Pas (78) : '; 'expected but' found
[Error] PRODPERIOD2. Pas (160) : Declaration expected but the end of the 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, informs the unit 'PRODPERIOD2. Pas'










CodePudding user response:

If XXX then
The begin
.
End//no semicolon
The else
The begin
end;

If XXX then
Do_something//no semicolon
The else
Do_otherthing;

58 line that the else obviously wrong,

CodePudding user response:

LZ code good mess, I found the error:
1, else don't before the semicolon;
2, the first the if... Then ttype after missing semicolon;
3, the back of the numberPlies assignment number=less,
Are some of the details
  • Related