I’m trying to create a text file with data in. I looked in the help and found the following code:
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
’);
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 “type of conversion is not possible because 1 of the operators contains an invalid type . Outstream. := Type”. What is the problem here? Is this the best way to create a text file with data in?
Thanks in advance.
Regards,
Merril