SysChat is a free online computer support community. Ask questions, share resources, contribute knowledge and discuss technology. Join our growing community to access all features. Register Now!

SysChat » Software Support » Development » "Select Case" with VBScript

Development

Support help and discuss software development and programming.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 06-28-2007, 08:50 AM
mhookem's Avatar
mhookem mhookem is offline
Moderator
 
About:
Join Date: Dec 2006
Location: Chesterfield, UK
Posts: 387
mhookem will become famous soon enoughmhookem will become famous soon enough

Page "Select Case" with VBScript


Hello, I've got a problem getting some VBScript to work. Can anyone point me in the right direction and tell me what I'm doing wrong?

Here is the code:


<body>
<%
Dim myNum
myNum=5
Select Case Number
Case 2
Response.Write("Two")
Case 3
Response.Write("Three")
Case 5
Response.Write("Five")
Else Case
Response.Write("No Number")
End Select
%>
</body>

I keep getting the error message 'An error occurred on the server when processing the URL. Please contact the system administrator'

Thanks

Martin



Reply With Quote
  #2 (permalink)  
Old 06-28-2007, 08:35 PM
William_Wilson's Avatar
William_Wilson William_Wilson is offline
Moderator
 
About:
Join Date: Mar 2006
Location: Canada
Posts: 973
William_Wilson has a spectacular aura aboutWilliam_Wilson has a spectacular aura aboutWilliam_Wilson has a spectacular aura about

Default


vb script is not a language i am familiar with, but this has the setup of a switch statement of other languages, there is usually a break command at the end of each case to prevent incorrect output.



__________________

</Dream In Code>
-William. § (marvin_gohan)
Reply With Quote
  #3 (permalink)  
Old 06-29-2007, 02:08 PM
mhookem's Avatar
mhookem mhookem is offline
Moderator
 
About:
Join Date: Dec 2006
Location: Chesterfield, UK
Posts: 387
mhookem will become famous soon enoughmhookem will become famous soon enough

Page VBScript


Quote:
Originally Posted by William_Wilson View Post
vb script is not a language i am familiar with, but this has the setup of a switch statement of other languages, there is usually a break command at the end of each case to prevent incorrect output.
Hello William, I've tried it but still no joy, I've even copy and pasted the code from several different sources.
Is there a possibility that it has something to do with my settings?

I've been practicing using IIS 7.0, and I've created cookies, Sessions and all sorts, but this just doesn't want to work!!

Regards

Martin



Reply With Quote
  #4 (permalink)  
Old 08-07-2008, 05:13 PM
kjb_work kjb_work is offline
Junior Member
 
About:
Join Date: Aug 2008
Posts: 1
kjb_work is on a distinguished road

Default


Quote:
Originally Posted by mhookem View Post
Hello, I've got a problem getting some VBScript to work. Can anyone point me in the right direction and tell me what I'm doing wrong?

Here is the code:


<body>
<%
Dim myNum
myNum=5
Select Case Number
Case 2
Response.Write("Two")
Case 3
Response.Write("Three")
Case 5
Response.Write("Five")
Else Case
Response.Write("No Number")
End Select
%>
</body>

I keep getting the error message 'An error occurred on the server when processing the URL. Please contact the system administrator'

Thanks

Martin
well first off I would say Number is not declared. If you wish to case on myNum then you should have


Select Case myNum
Case 2
do stuff
Case 3
do diff stuff
end select


VBscript does not have a break statement.

kjb



Reply With Quote
  #5 (permalink)  
Old 08-07-2008, 05:22 PM
Wombat's Avatar
Wombat Wombat is offline
Senior Member
 
About:
Join Date: Jan 2008
Location: Australia
Posts: 569
Wombat is on a distinguished road

Default


I do not think the OP will bother with your reply, he/she was last seen in this thread on the 28th June 2007.

Leave old threads to wither and die...



__________________


Wombat's: Bulldozers of the bush...
Reply With Quote
Reply




Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are on



» Ads



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54