|
-
Nov 21st, 2002, 10:52 AM
#1
Thread Starter
Addicted Member
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
-
Nov 21st, 2002, 10:55 AM
#2
Addicted Member
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
-
Nov 21st, 2002, 10:57 AM
#3
Thread Starter
Addicted Member
Cheers.
I have seen the Goto command in asp before though.
Is it possible.
Thanks.
-
Nov 22nd, 2002, 12:14 AM
#4
Do you mean like
VB Code:
'blah blah code
On Error Goto 0
' 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)
-
Nov 22nd, 2002, 12:17 AM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|