I'm sure I have read this somewhere, but how is the best way to handle this situation?
Let's say I have a function that returns a DataTable. The result of this function is based on if there are files in a certain location or not. If there are no files, then the function would either return null, or I should not call the function at all. So it seems like I should create a method that checks for files that is called first then based on those results, calls another method that returns the DataTable if it's there. The thing is, it would be nice to just call one method to get it all done. What happens if there is a null though? Do I just check for a null, or just pass a DataTable object with nothing in it, and check that it's empty?
Public Function NewFiles() As Boolean
' Check to see if log file date stamp is earlier than last write time in repository folder
' also checks to see if log exists
' the log file logs when files have been checked
' since this file is updated every time files are processed one can compare this file
' date to the file dates in the repository to know if a file is dropepd or not
' since the repository is read only all files remain in the repository even after
' they are dropped
NewFiles = False
m_checkLogResult = CheckLog(m_carrierName, m_logFileSpec, m_repoPath)
Select Case m_checkLogResult
MessageBox.Show("Log file does not exist.")
Public Function GetFileList() As DataTable
' What if this returns a void DataTable?