Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Visual Basic (.NET)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Complex example === This piece of code outputs [[Floyd's Triangle]] to the console: <syntaxhighlight lang="vbnet"> Imports System.Console Module Program Sub Main() Dim rows As Integer ' Input validation. Do Until Integer.TryParse(ReadLine("Enter a value for how many rows to be displayed: " & vbcrlf), rows) AndAlso rows >= 1 WriteLine("Allowed range is 1 and {0}", Integer.MaxValue) Loop ' Output of Floyd's Triangle Dim current As Integer = 1 Dim row As Integer Dim column As Integer For row = 1 To rows For column = 1 To row Write("{0,-2} ", current) current += 1 Next WriteLine() Next End Sub ''' <summary> ''' Like Console.ReadLine but takes a prompt string. ''' </summary> Function ReadLine(Optional prompt As String = Nothing) As String If prompt IsNot Nothing Then Write(prompt) End If Return Console.ReadLine() End Function End Module </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)