sgonzalez90
New member
- Joined
- Jul 7, 2011
- Messages
- 3
- Location
- Lowell, Massachusetts, United States
- Programming Experience
- 3-5
I want the second main for loop in the 1st main for loop, but I'm having a hard time integrating it so simply. The purpose of this program is to match coordinates and Pass/Fail them within a certain tolerance. I keep getting different results for axes-is other than s, can someone help me please?
VB.NET:
Private Sub startButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startButton.Click
On Error GoTo ErrHandler 'If error an error occurs go to the handler (bottom of sub)
'Kill Excel processes
If killCheck.Checked = True Then
Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("notepad")
For Each p As Process In pProcess
p.Kill()
Next
End If
'\\\START DECLARATIONS OF VARIABLES////////////////////////////////////////////////
'Declarations for excel application control
Dim xlApp As Excel.Application 'Set xlApp as an excel application
Dim xlBook As Excel.Workbook 'Set xlBook as an excel workbook
Dim xlSheet1 As Excel.Worksheet 'Set xlSheet1 as an excel worksheet
'Declarations for excel cell search and load manipulation
Dim currentRow As Integer 'For statement iterator (used below)
Dim position As Integer 'Used for Array position in testArray
Dim index As Integer 'Used for testArray itteration
Dim started As Boolean 'Have we searched through the Excel spreadsheet to the starting section yet?
Dim rindex As Integer 'Used for result1Array itteration
Dim relVal As Integer 'Converts result1Array to string after doubles are added together
'Declarations for columns of the Excel document (used for indexing and manipulating data)
Dim sectionColumn As Excel.Range 'Set sectionColumn as a range of values (values declared below)
Dim moveColumn As Excel.Range 'Excel column we search for a "move" in.
Dim resultColumn As Excel.Range 'Excel column we use for result comparisons
'Declarations for data arrays
Dim testArray() As String 'Test data array of strings
Dim result1Array() As String 'Top result data array of strings
Dim result2Array() As String 'Bottom result data array of strings
'Declarations for variables in the VB interface that we need to use
Dim srcStart As String 'Excel spreadsheet's starting test section
srcStart = section1Text.Text 'Set textbox to variable
Dim srcEnd As String 'Excel spreadsheet's ending test section
srcEnd = section2Text.Text 'Set textbox to variable
'Declarations for test data statistics
Dim pfColumn As Excel.Range 'Pass/Fail column
Dim passes As Integer 'Amount of passes
passes = 0 'Init passes to 0
Dim fails As Integer 'Amount of fails
fails = 0 'Init fails to 0
'\\\STARTUP CODE: Opens Excel and sets up the columns//////////////////////////////
xlApp = CreateObject("Excel.Application") 'Use xlApp as Excel Application...
If showCheck.Checked Then
xlApp.Visible = True 'Make spreadsheet visible?, user input checkbox
End If
xlBook = xlApp.Workbooks.Open(fileText.Text) 'Open the filepath of XLS doc selected, user defined by fileText
xlSheet1 = xlBook.Worksheets(sheetText.Text) 'Open the Test Cases worksheet, user defined by sheetText
sectionColumn = xlSheet1.Range(rangeText.Text) 'Set the search range of entire spreadheet
moveColumn = xlSheet1.Range(rangeText.Text).Offset(0, 3) 'moveColumn is set to the column we will search for a move command
resultColumn = xlSheet1.Range(rangeText.Text).Offset(0, 6) 'resultColumn is set to the column we will compare our 2 results from
pfColumn = xlSheet1.Range(rangeText.Text).Offset(0, 5) 'pfColumn is set to the Pass/Fail column, so we can write in a P/F, accordingly
'\\\START SEARCH AND COMPARE ALGORITHM////////////////////////////////////////////d() 'Start seaching for the section the user wants to test
For currentRow = 1 To sectionColumn.Count