Console: ReadLine |
Reads all of the characters from the current input source until a NewLine break is reached.
Public Function ReadLine ( ) As String
The ReadLine function will block and not return until a NewLine characters is pressed. This is usually the Return key.
This examples shows how to continually read a line of characters from the Console keyboard. The function will block and wait for a NewLine (Return Key) is reached. All characters are returned not including the the NewLine characters.
Dim s As String ' Reads all of the characters upto a NewLine break. ' If there are no characters (including NewLine) in the ' buffer, then the function will block and wait. s = Console.ReadLine ' Exit the loop if an empty line is returned. Do While Len(s) > 0 Debug.Print s DoEvents ' Continue reading an entire line at once. If no ' characters are available, then the function will ' block until the return key is pressed. s = Console.ReadLine Loop