TextIo.read Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads the next full record from a TextIO object.
public:
override cli::array <System::Object ^> ^ read();
public override object[] read ();
override this.read : unit -> obj[]
Public Overrides Function read () As Object()
Returns
A container that holds one record.
Remarks
Each entry in the container equals one field in the record. The definition of the next full record is controlled by the inFieldDelimiter, inRecordDelimiter, and inRecordLength properties. These properties have default values that allow input and output of the most common formats. It might be necessary to adjust the properties by using the inFieldDelimiter, inRecordDelimiter, and inRecordLength methods.
The following example reads a record from a file and uses the conpeek function to extract values from the record.
public void run()
{
container fileRecord;
IntrastatToProdCom intrastatToProdCom;
if (filename)
{
this.initializeFile();
fileRecord = prodComFile.read();
ttsbegin;
while (fileRecord)
{
intrastatToProdCom.IntrastatItemCodeID = conpeek(fileRecord, 1);
intrastatToProdCom.InventProdComCodeID = conpeek (fileRecord, 2);
intrastatToProdCom.ValidFromYear = conpeek (fileRecord, 3);
intrastatToProdCom.ValidTillYear = conpeek (fileRecord, 4);
intrastatToProdCom.insert();
filerecord = prodComFile.read();
}
ttscommit;
}
}