OutFile.TEXTMODE(TRUE); OutFile.WRITEMODE(TRUE); OutFile.CREATE('c:\msr.txt'); gbolFileCreated := TRUE; OutFile.CREATEOUTSTREAM(OutStream); OutStream.WRITETEXT('To: someone@somewhere.com'); OutStream.WRITETEXT(); OutStream.WRITETEXT('From: "Navison NAS" <superawesomeperson@somewhere.com>'); OutStream.WRITETEXT(); OutStream.WRITETEXT('Subject: Whatever'); OutStream.WRITETEXT(); OutStream.WRITETEXT('MIME-Version: 1.0'); OutStream.WRITETEXT(); OutStream.WRITETEXT('Content-Type: text/html;'); OutStream.WRITETEXT(); OutStream.WRITETEXT(' charset="iso-8859-1"'); OutStream.WRITETEXT(); OutStream.WRITETEXT('Content-Transfer-Encoding: quoted-printable '); OutStream.WRITETEXT(); OutStream.WRITETEXT('BODY OF EMAIL HERE<br>'); OutStream.WRITETEXT('Additional Lines below!!!!'); OutFile.CLOSE();I have declared the Outfile as type File. But when I compile this code, I get an error
What is the problem here? Is this the best way to create a text file with data in?type of conversion is not possible because 1 of the operators contains an invalid type . Outstream. := Type
Answers
But the outstream is not really necessary.
Try this:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
How do you have your variables declared?
The code you have supplied works fine for me, are you sure you have declared 'OutStream' as datatype OutStream? (Also you might want to use less ambiguous variable names. How about 'oStream' ?)
Yeah I was thinking somewhat the same, until I tried it out 8-[
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!