Io.writeExp Method

Writes the content of a container to the file.

Syntax

public boolean writeExp(container data)

Run On

Called

Parameters

  • data
    Type: container
    The container with data for the record.

Return Value

Type: boolean
true if the operation succeeded; otherwise false.

Remarks

If this method returns false, check the status method for the cause.

The entries in the container are treated as fields, and the container is treated as a full record. The field separator is defined in the outFieldDelimiter method. The record separator is defined in the outRecordDelimiter method.

Examples

static void testMethod(Args _args) 
{ 
    FileIOPermission _perm; 
    container c; 
    CommaIo myfile; 
 
    _perm = new FileIOPermission("myfile.txt","w"); 
    _perm.assert(); 
     
    myfile = new CommaIo("myfile.txt","w"); 
    // Assign the entries in the container according to record layout. 
    c = [1,"MyText",1.324,"Last field"]; 
    // write this record according to file format (record/field delimiters). 
    myfile.writeExp(c); 
}

See Also

Io Class

Io.outFieldDelimiter Method

Io.outRecordDelimiter Method

Io.status Method

Io.write Method