Get the App
SLTechnology News&Howtos  ›  Development  › 

The usage of ReadLine method under VBS

Shulou Source: shulou.com Published: 2022-06-03 19:38:59 11月03日 Update

This article mainly introduces "the usage of ReadLine method under VBS". In the daily operation, I believe that many people have doubts about the usage of ReadLine method under VBS. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the usage of ReadLine method under VBS". Next, please follow the editor to study!

Reads an entire line of characters from the TextStream file (up to the next line, but not the next line) and returns the result string.

Object.ReadLine

Object should be the name of the TextStream object.

Description

The following example shows how to use the ReadLine method to read characters from a TextStream file and return a string:

Function ReadLineTextFile Const ForReading = 1, ForWriting = 2 Dim fso, MyFile Set fso = CreateObject ("Scripting.FileSystemObject") Set MyFile = fso.OpenTextFile ("c:\ testfile.txt", ForWriting, True) MyFile.WriteLine "Hello world!" MyFile.WriteLine "The quick brown fox" MyFile.Close Set MyFile = fso.OpenTextFile ("c:\ testfile.txt", ForReading) ReadLineTextFile = MyFile.ReadLine 'Returns "Hello world!" End Function, the study of "the usage of ReadLine under VBS" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Methods characters learning one line strings files more help practical next examples names objects articles theories knowledge articles results websites materials Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info NVidia vpn Apple Linux