| 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.
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 LoopAs shown here, the loop continually reads in an entire line of charactersuntil an empty line is returned. The function blocks when no characters remainto be read in from the console input. The NewLine characters are not returnedwith the line.
Project VBCorLib Overview Class Console Overview Console Properties Console Methods ReadKey ResetColor