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: 254
mhookem will become famous soon enoughmhookem will become famous soon enough
Send a message via MSN to mhookem

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: 898
William_Wilson has a spectacular aura aboutWilliam_Wilson has a spectacular aura aboutWilliam_Wilson has a spectacular aura about
Send a message via MSN to William_Wilson

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: 254
mhookem will become famous soon enoughmhookem will become famous soon enough
Send a message via MSN to mhookem

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 online now
Senior Member
 
About:
Join Date: Jan 2008
Location: Australia
Posts: 466
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


» Sponsors
» Subscribe
AddThis Social Bookmark Button

AddThis Feed Button