TextIo.write Method

Writes data to a file represented by a TextIO object.

public boolean write ( _values)




The value(s) to write to the file. These values can be of different data types.

true if the write operation succeeds; otherwise, false. If the write operation fails, the TextIO.status method can be used to ascertain the cause.


The write method accepts a variable number of arguments. Each value is put into the output record as a field. The fields are separated by the field delimiter specified by the TextIo.outFieldDelimiter method. Each record is separated by the delimiter specified by the TextIo.outRecordDelimiter method.

To write complete containers, use the TextIo.writeExp method.

The following example writes data to a TextIO object called file.

protected void headingRecord()
    outputTxt = strdel(outputTxt, 1, strlen(outputTxt));

    outputTxt += this.recordCode(#PresenterHeadingRecordCode);
    outputTxt += dataCode;
    outputTxt += strLFix(CompanyInfo::find().VATNum, #NIF);
    outputTxt += suffix;
    outputTxt += strRFix(this.applyDateFormat(systemdateget()), #Date, '0');
    outputTxt += strrep(' ', 6);
    outputTxt += strLFix(strupr(CompanyInfo::name()), #Name);
    outputTxt += strrep(' ', 20);
    outputTxt += strRFix(
            #RegNum, '0');
    outputTxt += strrep(' ', 12);
    outputTxt += strrep(' ', 40);
    outputTxt += strrep(' ', 14);
    outputTxt = strLFix(outputTxt,recordLength);

Community Additions