"Listing Contents of Sub-Folders"
Comments in-line
I had never heard of Option Base 1, and I didn't know there are
several option statements. I understand from this group that using
Option Explicit is a good practice.
1. Can a procedure have more than one Option statement?
Put your cursor on the word Option, then press F1 to get help. Yes, there are
several Option statements: Option Explicit, Option Base 1, Option Compare
Text/Binary, etc
2. Does Option Base 1 force explicit declaration?
No, that's Option Explicit
Concerning the line, If Right$(Directory, 1) <
Application.PathSeparator Then
1. What is the purpose of the $?
The statement creates a temporary variable. Using the $ at the end means that
Right function should create a STRING variable rather than a variant. It's
better to avoid variants when you can, as it takes extra time to process them
-- the basic engine has to look up the variable, determine its type, then
possibly convert it to what is needed, in this case a string.
|