troubleshooting Question

Array Help

Avatar of gr8life
gr8life asked on
Visual Basic.NET
6 Comments1 Solution174 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 6 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 6 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004