I am debugging a project right now and it has a function with the following signature:
Public Function changeRemoteDirectory(ByVal newDirectory As String, Optional ByVal Direction As Boolean = True) As Boolean
MsgBox(direction)
'rest of code
End Function
I was trying to figure out what was causing this function to return a value of False
when I knew that it should return True
given the input that I was supplying, so I put MsgBox(direction)
into the Function
to see what the value of direction
was when I called the Function
. I called the function like this, yet I received a MsgBox
that showed the value of direction
to be False
:
changeRemoteDirectory("/internal")
The first parameter works just fine and the code that requires it to execute works correctly, but I cannot figure out why Direction
has a value of False
in a situation where, I believe, it should have its default value of True
. I'm not totally opposed to rewriting the Function
if need be, but can anybody here discern why Direction
does not have a value of True
when the function changeRemoteDirectory()
is called without the second parameter supplied?