View Single Post
Old 06-17-2009   #1 (permalink)
Albert Andersson


 
 

select case does not work ... why?

Hello

I have a Select Case statement with 3 cases and the else statement.

case 1 and 2 works fine but 3 not. And this even if i put the same code
like 1 or 2 in it.
Maybe Switch /case just dont work the way like i'm used from C#.

also when i create a if elseif elsfif else statement only the first
elseif seems to work, the secont not.

my Code runs in a aps site and the variable im looking for is a url
parameter.

Dim param
param = Request("Param")

My case looks like This:

select case param
case "1":
'code a
case "2":
'code b
case "3":
'code b
case else
'code d
end select

the if elseif statement looks like this:

if param = "1" then
'code a
elseif param = "2" then
'code b
elseif param = "3" then
'code b
else
'code c
end if

1,2,3 are actually the real values, since they represent type-codes.

may be there are some strange restrictions i dont know about.
As you see in 2 and 3 runs actually the same code ... so i really dont
know whats the matter.

Is there no way to debugg VBA on IIS? I installed the scriptconsole,
activated debugging opened the site in te script debugger (MS) but
nothing happens.

Here the real CODE:

Select Case notification_type
Case "1":
' Accepted Job applications submitted within the last 7 days (until
last midnight)
submission_date_from = DateAdd("d", -6, submission_date_to)
status = 3
range_text = "between " & submission_date_from & " and " &
submission_date_to
subject = "Accepted Job Applications Submitted " & range_text
no_applications_text = "There are no accepted job applications that
were submitted " & range_text & "."
Case "2":
' Accepted Job applications submitted within the last 30 days (until
last midnight)
submission_date_from = DateAdd("d", -29, submission_date_to)
status = 3
range_text = "between " & submission_date_from & " and " &
submission_date_to
subject = "Accepted Job Applications Submitted " & range_text
no_applications_text = "There are no accepted job applications that
were submitted " & range_text & "."
Case "3":
' Accepted Job applications submitted within the last 30 days (until
last midnight)
submission_date_from = DateAdd("d", -29, submission_date_to)
status = 3
range_text = "between " & submission_date_from & " and " &
submission_date_to
subject = "Accepted Job Applications Submitted " & range_text
no_applications_text = "There are no accepted job applications that
were submitted " & range_text & "."
Case Else
' All job applications submitted yesterday
submission_date_from = submission_date_to
range_text = "on " & submission_date_from
subject = "Job Applications Submitted " & range_text
no_applications_text = "No job applications were submitted " &
range_text & "."
End Select


mfg
Albert
My System SpecsSystem Spec