次の方法で共有


Io.writeExp(Object[]) Method

Definition

Writes the content of a container to the file.

public:
 virtual bool writeExp(cli::array <System::Object ^> ^ _data);
public virtual bool writeExp (object[] _data);
abstract member writeExp : obj[] -> bool
override this.writeExp : obj[] -> bool
Public Overridable Function writeExp (_data As Object()) As Boolean

Parameters

_data
Object[]

The container with data for the record.

Returns

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.

The following example demonstrates the writeExp method.

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); 
}

Applies to