These methods are functions that return a "stream" that carries the text from your app to the text file. If you are creating a new text file or overwriting an existing text file, use the Create shared method of the TextOutputStream class. Once you have a FolderItem that represents the text file you wish to open and write to, you open the file using the Append shared method of the TextOutputStream class. It assumes that the valid text file types have been defined in a File Type Set called TextTypes: This code lets the user choose a text file using the Open-file dialog box and displays the text in a TextArea. When you are finished reading text from the file, call the TextInputStream's Close method to close the stream to the file, making the file available to be opened again. This property will be True when the end of the file has been reached. As you read text, you can determine if you have reached the end of the file by checking the TextInputStream's EndOfFile property. The ReadLine method returns the next line of text (the text after the last character read but before the next end of line character). The TextInputStream.ReadAll method returns all the text from the file (via the TextInputStream) as a String. The TextInputStream keeps track of the last position in the file you read from. You then use ReadAll or ReadLine methods of the TextInputStream to get the text from the text file. This is a special class of object designed specifically for reading text from text files. This method is a function that returns a “stream” that carries the text from the text file to your application. Once you have a FolderItem that represents an existing text file you wish to open, you open the file using the Open shared method of the TextInputStream class.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |