Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


scripting issue from a newbie

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,52794
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> scripting issue from a newbie
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 scripting issue from a newbie - 10/18/2007 1:50:15 AM   
  anthonyqa

 

Posts: 1
Score: 0
Joined: 10/18/2007
Status: offline
ok...I feel like an **** asking this question because it is probably a simple answer...the problem is I am not a developer and can't even play one on TV.  I have a script that reads an excel spreadsheet and then compares that record to a lineArray.  The problem comes in here.  We are now moving to the new year so the spreadsheet has changed.  I have two statements here but i really need to combine them into one..and I need to add an IF THEN statement because if I check Plan Code 2007 if "NA" then check Plan Code 2008 then compare the 2008 Rider Code…if there was a value in Plan Code 2007 then compare Rider Code 2007...any help would be greatly appreciated since I have to move this logic to 5 or 6 different scripts.
'check rider code 1
 
planCnt = Ubound(planArray, 3)
For j = 0 to (planCnt - 3)
            if (lineArray(i,12) = planArray(j,0)) Then 'compare 2007 plan codes
               If planArray(j,2)="N/A" Then
                   planArray(j,2)=""
               End If
               If (lineArray(i,18) <> planArray(j,2)) Then 'compare 2007 rider codes
                   reporter.ReportEvent micFail, "Rider Code check", lineArray(i,17) & " : " & planArray(j,2) 'lineArray(i,17) & " did not match according to the plan code " & lineArray(i,12)
                  If planArray(j,2)="" Then
                        planArray(j,2)="N/A"
                 End If
                 Call writeExcel(hcnt + k,19,planArray(j,2),"fail",objExcel,objSheet)
                 Exit For
            Else
                Call writeExcel(hcnt + k, 19, planArray(j,2), "pass", objExcel, objSheet)
                Exit For
            End if
-----------------------------------------------------------------------------------------------------------
For j = 1 to (planCnt - 3)
            if (lineArray(i,12) = planArray(j,1)) Then 'compare 2008 plan codes
               If planArray(j,3)="N/A" Then
                   planArray(j,3)=""
               End If
               If (lineArray(i,18) <> planArray(j,3)) Then 'compare 2008 rider codes
                   reporter.ReportEvent micFail, "Rider Code check", lineArray(i,18) & " : " & planArray(j,3) 'lineArray(i,18) & " did not match according to the plan code " & lineArray(i,12)
                  If planArray(j,3)="" Then
                        planArray(j,3)="N/A"
                 End If
                 Call writeExcel(hcnt + k,19,planArray(j,3),"fail",objExcel,objSheet)
                 Exit For
            Else
                Call writeExcel(hcnt + k, 19, planArray(j,3), "pass", objExcel, objSheet)
                Exit For
            End if
 
 
 '''''''''''''''''''''''''''''''''''''open excel file that contains the report
Dim objExcel,objSheet,intRow,intcol, cnt, city, mcnt  
Dim fso, fldr, myPath
Dim fileArray()   
Dim LineArray(), planArray(), headerArray()
i = 1
j=1
k=0

 '''open sheet that contains plan numbers and rider codes
ReDim planArray(planRows-1,3) 'first 2 dimensions contains plan codes, last 2 dimensions contains ridercodes
 
For i=3 to planRows
                        planArray(i-3,0)=objSheet.Cells(i,7)
                        planArray(i-3,1)=objSheet.Cells(i,8)
                        planArray(i-3,2)=objSheet.Cells(i,17)
                        planArray(i-3,3)=objSheet.Cells(i,18)
Next
 
Thank you for any help you can give forum members and forgive me.
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> scripting issue from a newbie Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts