次の方法で共有


Io.read Method

Definition

Reads the next full record from the Io object.

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

Returns

Object[]

A container that holds the next full record from the Io object.

Remarks

The definition of the next full record is controlled by the inFieldDelimiter, inRecordDelimiter, and inRecordLength method properties. The record is returned as a container. Each entry in the container equals one field in the record. Each of the specialized Io classes has default settings for inFieldDelimiter, inRecordDelimiter, and inRecordLength enabling input and output of the most common formats. You might have to adjust these to support the wanted format.

This method demonstrates the use of the run method. However, the following example will not compile in a job as it must be run in the context of a class, form, or other object.

static void Job1(Args _args) 
{ 
    FileIoPermission _perm; 
    AsciiIo myfileio; 
    Container c; 
    _perm = new FileIoPermission("myfile.txt","r"); 
    myfileio = new AsciiIo("myfile.txt","r"); 
    while(myfileio.status()==IO_Status::OK) 
    { 
        c = myfileio.read(); 
        // ...do something with the container 
    } 
}

Applies to