Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

DTS USING ACTIVE X SCRIPT - ARE NESTED IF STATEMENTS POSSIBLE?

Hi Experts,

I use DTS to run scheduled active X scripts using vbscript.

I need to nest an if statement, but which ever way i come at it it doesn't seem to work - the code is below - if anyone can tell me if this is possible or indeed if there's another way around it i'd be really grateful.

      Case "dropOffTime", "startTime"
      
            If (x.name) = "dropOffTime" and Trim(x.Value) <> "" Then
                  vTimes = left(x.value,2) & right(x.value, 2)
            End If
                  If (x.name) = "startTime" Then

                  If Not vTimes = "" Then
                        vTimes = left(x.value,2) & right(x.value, 2)
                  End If

            End If
                  strLine = strLine & vTimes

The dropOffTime variable works fine, but i get nothing coming back for startTime which always exists in the absence of a dropOffTime variable....
0
pjordanna
Asked:
pjordanna
1 Solution
 
jrb1Commented:
Should that line be changed to:

     Case "dropOffTime", "startTime"
     
          If (x.name) = "dropOffTime" and Trim(x.Value) <> "" Then
               vTimes = left(x.value,2) & right(x.value, 2)
          End If
               If (x.name) = "startTime" Then

 --->         If vTimes = "" Then
                    vTimes = left(x.value,2) & right(x.value, 2)
               End If

          End If
               strLine = strLine & vTimes

0
 
pjordannaAuthor Commented:
many thanks - didn't quite fix it but helped
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now