Reads text from an InStream object.
|
[Read := ] InStream.ReadText(Text[, Length])
|
Parameters
- Text
-
Type: Text
The variable that receives the characters that were read
- Length
-
Type: Integer
The number of characters to be read. If you do not specify this
parameter, the maximum length of the string is used.
Property Value/Return Value
Type: Integer
The number of characters that were read.
Remarks
Example
This example shows how to use the InStream.READTEXT
function. This example requires that you create the following
variables.
Variable name |
DataType |
FileTest
|
File
|
StreamInTest
|
InStream
|
Int
|
Integer
|
Txt
|
Text
|
|
Copy Code |
FileTest.OPEN('c:\XMLDocs\NewTest.txt');
FileTest.CREATEINSTREAM(StreamInTest);
// Starting a loop
WHILE NOT (StreamInTest.EOS) DO BEGIN
Int := StreamInTest.READTEXT(Txt,100);
MESSAGE(Txt + '\Size: ' + FORMAT(Int));
END;
FileTest.CLOSE();
|
See Also