Wrox Programmer Forums
Visual Basic 2008 Professionals For advanced Visual Basic coders working in version 2008. Beginning-level questions will be redirected to other forums,
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 27th, 2008, 11:39 AM
Posts: n/a
Default vb 2008 exsp

How Do You make a line Loop Like If Textbox1.text = "1" Then goto line 2: Line 2 If Textbox3 . text = 2 then goto lastline My question is in console application i want to be able to hit 1 then it gose to line1 hit 2 gose to Lastline bout i want the console to read visual basic 2008 express edtion textboxes

Imposiable is Always Posibles... No matter what it takes.
Old August 27th, 2008, 02:15 PM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

To post code, click the [[u]#</u>] button. It inserts a pair of tags; put your code between those tgs and it will be fixed spacing, and will be presented literally as you type it.

That bold, red, weird-font is really hard to read...
Your best bet IMO is a Select Case structure:
    ' Get the input.  In this case it would be in the variable Answer
    ' Then use it in a Select Case statement:

    Select Case Answer
        Case 1
            ' Put the code here that would be at the GoTo Line 1
            ' area.  Alternately, write a routine like:
        Case 2
            ' Put the code here that would be at the GoTo Line 2
            ' area.  Alternately, write a routine like:
        Case 3
            ' Put the code here that would be at the GoTo Line 3
            ' area.  Alternately, write a routine like:
    End Select
    Jumping around with GoTo methods is considered very bad form. It makes programs really hard to read (when trying to figure out what they are supposed to be doing), really hard to maintain (if you need to modify how they work or if you have to repair an error, typo, whatever).

If you go to a job interview, and your portfolio has samples with
    If Answer = 1 Then
        GoTo 1
    ElseIf Answer = 2 Then
        GoTo 2
    ElseIf Answer = 3 Then
        GoTo 3
    End If
    You can be guaranteed to not get the job...

PS: It is “goes,” not “gose,” and “I” is capitalized when talking about yourself.

And, in reality, some things are actually impossible...
Old September 27th, 2008, 10:56 AM
Registered User
Join Date: Sep 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

As opposed to "Imposiable" and possible as opposed to "Posibles"? Strange, since the OP has "USA" as place where he/she lives. I really hope that residents of the US who are attempting to handle something like VB.NET, or ANY programming would have somewhat better of an education and a much better hold on spelling/grammar! If it's not education or not having English as a native language, it's got to be just plain laziness, I mean we have a spell checker at our disposal...

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning VB 2008 mhccStudent Visual Basic 2008 Essentials 1 September 22nd, 2009 06:06 PM
Printing from VB 2008 BroadwayLion Visual Basic 2008 Essentials 1 September 27th, 2008 12:02 PM
why buy vs-2008 instead of vb-2008 jerryham VB.NET 7 September 2nd, 2008 02:39 PM
Downloading VB 2008 Express Kiddi Visual Basic 2008 Essentials 1 June 11th, 2008 12:29 PM
How do I write this vb 6 code to work in vb 2008? sanderson Visual Basic 2008 Essentials 3 June 10th, 2008 01:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.