Should a function that originally doesn't return a value return Nothing
anyway (as Visual Studio puts a green squiggle in the End Function
statement asking if you'd forget to return a value), or I can ignore VS' tip? What is the impact in returning Nothing
, or anything at all?
tl;dr: Should this example code return Nothing
or it is not needed? Elucidations are really welcome!
Public Shared sCaminhoGravacaoXML As String = "C:\XMLData\"
Public Shared Function VerificaPastasXML()
If Not IsNothing(sCaminhoGravacaoXML) And sCaminhoGravacaoXML <> "" Then
Dim sRaiz As String = sCaminhoGravacaoXML
If Not FileIO.FileSystem.DirectoryExists(sRaiz) Then
FileIO.FileSystem.CreateDirectory(sRaiz)
End If
If Not Directory.Exists(sRaiz & "tempXML") Then
Dim diInfo As DirectoryInfo = Directory.CreateDirectory(sRaiz & "tempXML")
diInfo.Attributes = FileAttributes.Directory Or FileAttributes.Hidden
End If
Else
sErroBaixaXML = "Não foi possível montar a estrutura de pastas para os arquivos" & vbCrLf & "XML de NFe, favor consultar os parâmetros da filial!"
End If
End Function