intCounter = 1
For Each aElement In aArray
If aElement = "" Then
'its not neat to exit loops but it makes sense here?
Wscript.Echo "blank found on line " & CStr(intCounter)
Exit For
End If
intCounter = intCounter + 1
Next
'i guess you might want something like
If UBound(aArray) = intCounter Then 'might need to be + 1
Wscript.Echo "no blank line found, prob not strictly true could be the last line?"
Else
Wscript.Echo "blank line found on " & CStr(intCounter)
End If
'this might be a better approach, in my mind i like to avoid the use of booleans in this type of thing, seems to not be the most elegant
'blnFound = False
inCounter = 1
For Each aElement In aArray
If aElement = "" Then
'its not neat to exit loops but it makes sense here?
Wscript.Echo "blank found on line " & CStr(intCounter)
blnFound = True
Exit For
End If
intCounter = intCounter + 1
Next
If blnFound = True Then
Wscript.Echo "found on line " & CStr(intCounter)
Else
Wscript.Echo "didnt find blank " & CStr(intCounter)
End If
'you could have multiple blank lines?
'see, i knew the bln and the Exit For were a bad idea
Set dicBlankLines = CreateObject("Scripting.FileSystemObject")
inCounter = 1
For Each aElement In aArray
If aElement = "" Then
'its not neat to exit loops but it makes sense here?
Wscript.Echo "blank found on line " & CStr(intCounter)
dicBlankLines.Add CStr(intCounter), ""
End If
intCounter = intCounter + 1
Next
'
If dicBlankLines.Count = 0 Then
Wscript.Echo "no blank lines found"
Else
Wscript.Echo "blank lines found"
For Each aElement In dicBlankLines
Wscript.Echo "blank line found on " & aElement
Next
End If