Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 If one does not = ten then one = +1

$
0
0
As introduced above, I am trying to recreate a similar concept where its like a loop. I am looking for a very compact way for basis to add one if not equal to countTo.
You may include a loop and other things. Our goal is to make it very compact.

As shown, I tried to use Lines and GoTo's to go back like a loop but it doesnt seem to work.

Code:

Public Class Form1
    Dim basis As Double = 0
    Dim countTo As Double = 100

    Private Sub btnStart_Click(sender As System.Object, e As System.EventArgs) Handles btnStart.Click
Start:
        basis = +1
        lblCount.Text = "Count: " & basis.ToString
        If basis < countTo Then GoTo Start Else GoTo Finish
Finish: MsgBox("done")

    End Sub
End Class


Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>