Q&A

  • 회사에서 실력테스트중입니다. 시간이 엄떠서,
자꾸 글올려서 죄송합니다.

EXPECTED '=' but '('found

이게 무슨 error져???





unit Unit1;



interface



uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

StdCtrls;



type

TForm1 = class(TForm)

Edit1: TEdit;

Edit2: TEdit;

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

procedure Edit2Change(Sender: TObject);



private

{ Private declarations }

public

{ Public declarations }

end;



var

Form1: TForm1;



implementation



{$R *.DFM}



var

minusMunce : integer;



minusMunce := strtoint(edit1.text);



procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);



begin

if key=#13 then



begin

if Edit1.Text = '1' then

Edit1.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-2) )

+ ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-1) );



end;



procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);



begin

if Edit.Text = '2' then

Edit.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-4) )

+ ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-3) );

end;



end.



keypress시.....

if key=#13 then begin//만일 엔터키를 눌렀다면.....

Edit2.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-(strtoint(edit1.text)+1) )

+ ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-(strtoint(edit1.text)) );











2  COMMENTS
  • Profile
    김성중 2000.09.29 00:28
    //이부분에 (가 빠졌네요 (*다음부분 가로 추가 됨)



    Edit2.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-(strtoint(edit1.text)+1) )*)

    + ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-(strtoint(edit1.text))*) );















    mickyblue wrote:

    > 자꾸 글올려서 죄송합니다.

    > EXPECTED '=' but '('found

    > 이게 무슨 error져???

    >

    >

    > unit Unit1;

    >

    > interface

    >

    > uses

    > Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

    > StdCtrls;

    >

    > type

    > TForm1 = class(TForm)

    > Edit1: TEdit;

    > Edit2: TEdit;

    > procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

    > procedure Edit2Change(Sender: TObject);

    >

    > private

    > { Private declarations }

    > public

    > { Public declarations }

    > end;

    >

    > var

    > Form1: TForm1;

    >

    > implementation

    >

    > {$R *.DFM}

    >

    > var

    > minusMunce : integer;

    >

    > minusMunce := strtoint(edit1.text);

    >

    > procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

    >

    > begin

    > if key=#13 then

    >

    > begin

    > if Edit1.Text = '1' then

    > Edit1.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-2) )

    > + ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-1) );

    >

    > end;

    >

    > procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

    >

    > begin

    > if Edit.Text = '2' then

    > Edit.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-4) )

    > + ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-3) );

    > end;

    >

    > end.

    >

    > keypress시.....

    > if key=#13 then begin//만일 엔터키를 눌렀다면.....

    > Edit2.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-(strtoint(edit1.text)+1) )

    > + ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-(strtoint(edit1.text)) );

    >

    >

    >

    >

    >

  • Profile
    임형호 2000.09.28 23:33
    그것은 '=' 나와야되는데 '('이 나왔다는 얘기이거든요. 직역을 하자면요..

    그러니까 코딩을 찬찬히 살펴보세요. '(' 의 갯수라든지...

    어떤 처리부분의 형식이 틀려서 그런경우가 십중팔구입니다.





    mickyblue wrote:

    > 자꾸 글올려서 죄송합니다.

    > EXPECTED '=' but '('found

    > 이게 무슨 error져???

    >

    >

    > unit Unit1;

    >

    > interface

    >

    > uses

    > Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

    > StdCtrls;

    >

    > type

    > TForm1 = class(TForm)

    > Edit1: TEdit;

    > Edit2: TEdit;

    > procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

    > procedure Edit2Change(Sender: TObject);

    >

    > private

    > { Private declarations }

    > public

    > { Public declarations }

    > end;

    >

    > var

    > Form1: TForm1;

    >

    > implementation

    >

    > {$R *.DFM}

    >

    > var

    > minusMunce : integer;

    >

    > minusMunce := strtoint(edit1.text);

    >

    > procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

    >

    > begin

    > if key=#13 then

    >

    > begin

    > if Edit1.Text = '1' then

    > Edit1.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-2) )

    > + ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-1) );

    >

    > end;

    >

    > procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

    >

    > begin

    > if Edit.Text = '2' then

    > Edit.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-4) )

    > + ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-3) );

    > end;

    >

    > end.

    >

    > keypress시.....

    > if key=#13 then begin//만일 엔터키를 눌렀다면.....

    > Edit2.Text := FormatDateTime( 'YYYY.MM', IncMonth(Now,-(strtoint(edit1.text)+1) )

    > + ' ~ ' + FormatDateTime( 'YYYY.MM', IncMonth(Now,-(strtoint(edit1.text)) );

    >

    >

    >

    >

    >