gr8life
asked on
Array Help
I am trying to express the code below into a better approach. I tried to use an array but was unsuccessful.
Thank you very much for taking time to read this post,
Gr8life
ConvertFiles(inFile, outFile1, outFile2, outFile3, outFile4, outFile5, outFile6, outFile7, outFile8, outFile9, outFile10, outFile11, outFile12, outFile13, outFile14, outFile15, outFile16, outfile17, outfile18)
If ((outFile1.Length > 0) And (outFile2.Length > 0) And (outFile3.Length > 0) And (outFile4.Length > 0) And (outFile5.Length > 0) And (outFile6.Length > 0) And (outFile7.Length > 0) And (outFile8.Length > 0) And (outFile9.Length > 0) And (outFile10.Length > 0) And (outFile11.Length > 0) And (outFile12.Length > 0) And (outFile13.Length > 0) And (outFile14.Length > 0) And (outFile15.Length > 0) And (outFile16.Length > 0) And (outfile17.Length > 0) And (outfile18.Length > 0)) Then
Bigger picture:
Dim startDT As DateTime = DateTime.Now
If (inFile.Length > 0) Then
Button1.Visible = False
ConvertFiles(inFile, outFile1, outFile2, outFile3, outFile4, outFile5, outFile6, outFile7, outFile8, outFile9, outFile10, outFile11, outFile12, outFile13, outFile14, outFile15, outFile16, outfile17, outfile18)
End If
If ((outFile1.Length > 0) And (outFile2.Length > 0) And (outFile3.Length > 0) And (outFile4.Length > 0) And (outFile5.Length > 0) And (outFile6.Length > 0) And (outFile7.Length > 0) And (outFile8.Length > 0) And (outFile9.Length > 0) And (outFile10.Length > 0) And (outFile11.Length > 0) And (outFile12.Length > 0) And (outFile13.Length > 0) And (outFile14.Length > 0) And (outFile15.Length > 0) And (outFile16.Length > 0) And (outfile17.Length > 0) And (outfile18.Length > 0)) Then
Dim stopDT As DateTime = DateTime.Now
Dim elapsedTS As TimeSpan = stopDT.Subtract(startDT)
Dim msg As String = elapsedTS.Hours & "h" & elapsedTS.Minutes & "m" & elapsedTS.Seconds & "s" & elapsedTS.Milliseconds & "ms"
MessageBox.Show("File Complete!" & ControlChars.CrLf & ControlChars.CrLf & "Process Duration:" & ControlChars.CrLf & msg)
Button1.Visible = True
Button1.Enabled = True
Else
MsgBox("No output file specified!")
End If
Catch ex As Exception
MsgBox("Error in Button1_Click :" & ex.Message)
End Try
Thank you very much for taking time to read this post,
Gr8life
ConvertFiles(inFile, outFile1, outFile2, outFile3, outFile4, outFile5, outFile6, outFile7, outFile8, outFile9, outFile10, outFile11, outFile12, outFile13, outFile14, outFile15, outFile16, outfile17, outfile18)
If ((outFile1.Length > 0) And (outFile2.Length > 0) And (outFile3.Length > 0) And (outFile4.Length > 0) And (outFile5.Length > 0) And (outFile6.Length > 0) And (outFile7.Length > 0) And (outFile8.Length > 0) And (outFile9.Length > 0) And (outFile10.Length > 0) And (outFile11.Length > 0) And (outFile12.Length > 0) And (outFile13.Length > 0) And (outFile14.Length > 0) And (outFile15.Length > 0) And (outFile16.Length > 0) And (outfile17.Length > 0) And (outfile18.Length > 0)) Then
Bigger picture:
Dim startDT As DateTime = DateTime.Now
If (inFile.Length > 0) Then
Button1.Visible = False
ConvertFiles(inFile, outFile1, outFile2, outFile3, outFile4, outFile5, outFile6, outFile7, outFile8, outFile9, outFile10, outFile11, outFile12, outFile13, outFile14, outFile15, outFile16, outfile17, outfile18)
End If
If ((outFile1.Length > 0) And (outFile2.Length > 0) And (outFile3.Length > 0) And (outFile4.Length > 0) And (outFile5.Length > 0) And (outFile6.Length > 0) And (outFile7.Length > 0) And (outFile8.Length > 0) And (outFile9.Length > 0) And (outFile10.Length > 0) And (outFile11.Length > 0) And (outFile12.Length > 0) And (outFile13.Length > 0) And (outFile14.Length > 0) And (outFile15.Length > 0) And (outFile16.Length > 0) And (outfile17.Length > 0) And (outfile18.Length > 0)) Then
Dim stopDT As DateTime = DateTime.Now
Dim elapsedTS As TimeSpan = stopDT.Subtract(startDT)
Dim msg As String = elapsedTS.Hours & "h" & elapsedTS.Minutes & "m" & elapsedTS.Seconds & "s" & elapsedTS.Milliseconds & "ms"
MessageBox.Show("File Complete!" & ControlChars.CrLf & ControlChars.CrLf & "Process Duration:" & ControlChars.CrLf & msg)
Button1.Visible = True
Button1.Enabled = True
Else
MsgBox("No output file specified!")
End If
Catch ex As Exception
MsgBox("Error in Button1_Click :" & ex.Message)
End Try
hey gr8life what exactly your trying to do, and what is ConverFiles() is it a function?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hey Fernando, I have actually been reading a lot and trying to program. Thank you very much for the code. I will try it tonight.
Thank you for your time,
Gr8life
Thank you for your time,
Gr8life
Not a problem. ;=)
ASKER
I was working with solution provided and ran into some additional issues. I believe I can handle them myself. Thank you very much for the code. I believe once I make some changes to my other code I will be able to correctly use the solution provided.
Thank you for your time and expertise,
Gr8life
Thank you for your time and expertise,
Gr8life
Not a problem, always glad to help. ;=)