Results 1 to 5 of 5

Thread: Can anyone explain the Goto command

  1. #1

    Thread Starter
    Addicted Member sotusotusotu's Avatar
    Join Date
    Aug 2001
    Location
    Plymouth, England
    Posts
    158

    Can anyone explain the Goto command

    I have a a page with a text box called NumberEntered that goes to NumberEntered.asp.

    Can anyone please tell me whats wrong with this Goto method ?

    Heres the code for NumberEntered.asp

    ---------------------------------------------------------------------------------


    <%

    Dim NumberEntered
    NumberedEntered = Request.Form ("NumberEntered")

    If NumberEntered = 1 Then
    Goto 1
    Else
    Goto 2
    End If

    1:
    Response.Write "You Entered <b>1</b>"

    2:
    Response.Write "You Entered <b>2</b>"

    %>

    -------------------------------------------------------------------------------

    thanks


    __________________
    Living a Lie, Timmy

    Living a Lie, Timmy

  2. #2
    Addicted Member jestes's Avatar
    Join Date
    Jan 2001
    Location
    Dallas
    Posts
    248

    I don't this VBScript Uses GOTO

    Use a Select Case Instead
    [code]

    NumberedEntered = Request.Form ("NumberEntered")

    Select Case NumberedEntered

    Case 1

    blah blah

    Case 2
    blah

    End Select

  3. #3

    Thread Starter
    Addicted Member sotusotusotu's Avatar
    Join Date
    Aug 2001
    Location
    Plymouth, England
    Posts
    158
    Cheers.

    I have seen the Goto command in asp before though.

    Is it possible.

    Thanks.
    Living a Lie, Timmy

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Do you mean like

    VB Code:
    1. 'blah blah code
    2. On Error Goto 0
    3. ' more code

    but without a label? I haven't seen any "goto labelname" in VBScript myself. AFAIK, you use

    On Error Goto 0

    for normal error processing

    and

    On Error goto -1

    to disable error processing.

    (Or something like that)

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width