hey you guys,
can someone point me to internet resources that explain the following concepts like a human would talk, and not like a tech elitist that has lost their mind? I know most of these, but I just want to make sure I'm not missing anything:
=> recursion
=> polymorphism
=> encapsulation
=> abstraction
the one thing I want to know specifically is, how I can think of recursion in very simple terms. as in, are any of the following concepts relevant when a function calls itself?
=> bit/byte shifting
=> sorting (I know this is obviously part of it, but am missing a small piece of the puzzle)
=> what goes on in the mem slots when the self-calling goes on.
here's an example of a function, written in an extremely old language, that calls itself and puts vals into a collection object:
Private Function FillDir(colDirList As Collection, ByVal strFolder As String, strFileSpec As String, _
bIncludeSubfolders As Boolean)
'Build up a list of files, and then add add to this list, any additional folders
Dim strTemp As String
Dim colFolders As New Collection
Dim vFolderName As Variant
'Add the files to the folder.
strFolder = TrailingSlash(strFolder)
strTemp = Dir(strFolder & strFileSpec)
Do While strTemp <> vbNullString
colDirList.Add strFolder & strTemp
strTemp = Dir
Loop
If bIncludeSubfolders Then
'Build collection of additional subfolders.
strTemp = Dir(strFolder, vbDirectory)
Do While strTemp <> vbNullString
If (strTemp <> ".") And (strTemp <> "..") Then
If (GetAttr(strFolder & strTemp) And vbDirectory) <> 0& Then
colFolders.Add strTemp
End If
End If
strTemp = Dir
Loop
'Call function recursively for each subfolder.
For Each vFolderName In colFolders
Call FillDir(colDirList, strFolder & TrailingSlash(vFolderName), strFileSpec, True)
Next vFolderName
End If
End Function
thanks.
Edited by ajetrumpet, 23 February 2021 - 02:04 PM.



Back to top







