Lazarus
Free Pascal => FPC development => Topic started by: kinlion on May 25, 2019, 06:52:33 am
Title:
[SOLVED]Compile Error: WriteXMLFile(xml_doc, file_name)
Post by:
kinlion
on
May 25, 2019, 06:52:33 am
Lazarsu2.0.2 + FPC3.0.4 On Win10x64
I met with a weird problem:
The compiler compains: Incompatible type for the arg no.2: Got "AnsiString", Expected "TStream"
at this code:
Code: Pascal
[Select]
[+]
[-]
WriteXMLFile
(
xml_doc
,
file_name
)
;
However, if I use WriteXML instead, it has no problem.
I'm sure it's also no problem in Lazarsu1.8.4 + FPC3.0.4 On Win10x64 even using WriteXMLFile.
Is it a bug?
Title:
Re: Compile Error: WriteXMLFile(xml_doc, file_name)
Post by:
kinlion
on
May 25, 2019, 07:33:12 am
ReadXMLFile is similar
Title:
Re: Compile Error: WriteXMLFile(xml_doc, file_name)
Post by:
kinlion
on
May 25, 2019, 07:41:42 am
Sorry. I made a mistake.
The type of xml_doc should be TXMLDocument, but I defined it as a TDomDocument.
Title:
Re: [SOLVED]Compile Error: WriteXMLFile(xml_doc, file_name)
Post by:
ASerge
on
May 25, 2019, 07:45:32 am
This one compiles without a problem:
Code: Pascal
[Select]
[+]
[-]
uses
DOM
,
XMLWrite
,
XMLRead
;
var
S
:
string
=
''
;
Doc
:
TXMLDocument
=
nil
;
begin
WriteXMLFile
(
Doc
,
S
)
;
ReadXMLFile
(
Doc
,
S
)
;
end
.
Make a minimal project where the problem is reproduced.
TinyPortal
© 2005-2018