![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | Re: select case does not work ... why? Event if i write it like this it does not work. So what is wrong with "3" doen't make any sense: If notification_type = "1" Then ' 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 & "." End If If notification_type = "2" Then ' 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 & "." End If If notification_type = "3" Then ' Accepted Job applications submitted within the last 30 days (until last midnight) submission_date_from = DateAdd("d", -15, 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 & "." End If |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Script that uses the DatePart & Case select | VB Script | |||
| Logon script - function array and select case not working | VB Script | |||
| Re: Select case question | VB Script | |||
| Case/Select functionality | PowerShell | |||
| How can select -first X work, but not select -last X | PowerShell | |||