3.4. Displaying a Single Line of Text with Multiple Statements
The message Welcome to Visual Basic! can be displayed using multiple statements. Fig. 3.15 uses two method calls to produce the same output as the program in Fig. 3.1.
Figure 3.15. Displaying a line of text with multiple statements.
1 ' Fig. 3.15: Welcome2.vb 2 ' Displaying a line of text with multiple statements. 3 4 Module SecondWelcome 5 6 Sub Main() 7 8 Console.Write("Welcome to ") 9 Console.WriteLine("Visual Basic!") 10 11 End Sub ' Main 12 13 End Module ' SecondWelcome
|
Lines 8–9 of Fig. 3.15 display only one line of text in the Console window. The first statement calls Console method Write to display a string. Unlike WriteLine, Write does not position ...
Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.