다음과 같은 프로그램이 있는데 거의 작동하지만 컴파일을 시도 할 때 다음 오류가 발생합니다. 어떻게 해결해야할지 모르겠군요! 어떤 아이디어?파스칼 - 다시 : 용도
양식, 'mainform.pas'에서 mainform ...
이"로, Unit1.pas (9), 또는 예상하지만, 'IN'발견, "프로젝트 1은 Unit1.pas도를 컴파일 할 수
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Dialogs, LibXmlParser, LibXmlComps, StdCtrls,
Forms,
mainform in 'mainform.pas'
mapimail in 'mapimail.pas';
type
TXMLRule = Record
alert, desc, act:string;
end;
TForm1 = class(TForm)
Button1: TButton;
EasyXmlScanner1: TEasyXmlScanner;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Parser : TXmlParser;
MyXMLRules:Array[1..10] of TXMLRule;
i :1..10;
implementation
{$R *.dfm}
procedure ProcessXML();
begin
Parser := TXmlParser.Create;
Parser.Normalize := TRUE;
Parser.LoadFromFile ('c:\parser.xml');
Parser.StartScan;
while Parser.Scan do
case Parser.CurPartType of
ptStartTag,
ptEmptyTag :
begin
end;
ptContent :
begin
if Parser.CurName = ('<alert>') then MyXMLRules[1].alert := Parser.CurContent;
if Parser.CurName = ('<desc>') then MyXMLRules[1].desc := Parser.CurContent;
if Parser.CurName = ('<action>') then MyXMLRules[1].act := Parser.Curcontent;
end;
end;
Parser.Free;
end;
procedure EmailAlert();
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
procedure NoiseAlert();
begin
end;
procedure TForm1.Button1Click(Sender: TObject);
var
f:textFile;
data:string;
begin
ProcessXML();
AssignFile(f, 'c:\nmap.txt');
reset(f);
repeat
readln(f, data);
if (pos(MyXMLRules[1].alert, data)) <> 0 then
begin
if MyXMLRules[1].act
= ('Email') then
begin
EmailAlert
end;
if MyXMLRules[1].act
= ('Beep') then
begin
NoiseAlert
end;
end;
until EOF(f);
end;
end.
사실입니다.하지만 파서가 아직까지 그렇게 생각하지 않았습니다. – RobS
그래, 아마 맞을거야. 나는 6 년 넘게 파스칼에 손을 대지 않았으므로 조금 녹슬었다. ;) –