2022.2

Table Of Contents
var fileIn = openTextReader(data.filename);
var tmp = createTmpFile();
var fileOut = openTextWriter(tmp.getPath());
var line;
while ((line = fileIn.readLine())!=null){
fileOut.write(line.replace((subject),""));
fileOut.newLine();
}
fileIn.close();
fileOut.close();
deleteFile(data.filename);
tmp.move(data.filename);
tmp.close();
TextWriter
TheTextWriterobject,returnedbytheopenTextWriter()function,allowstoopenatextfile,writetoit
andcloseit.
Methods
ThefollowingtabledescribesthemethodsoftheTextWriterobject.
Method Description
close() Closethestream.
newLine() Createsanewlineinthefile.
open(filename) Createsanewwriteronafiletowriteatthebeginningofthefile.
Parameters:
l
filename:thepathofthefiletoopen
open(inFilename,inEncoding,append) Createsanewwriteronafile.
Parameters:
l
inFileName:thepathofthefile
l
inEncoding:theencodingtobeusedwhenwritingtothefile
l
append:boolean;trueifthedatawillbewrittenattheendofthefile
write(c) Writesacharacterinthefile
write(value) Writesastringinthefile.
Parameters:
l
value:thestringvaluetowrite
The Designer
TheDesignerisaWYSIWYG(whatyouseeiswhatyouget)editorthatletsyoucreatetemplatesfor
variousoutputchannels:Print,EmailandWeb.
Page 412