I have asked this question before and no one got it right. See if you can answer this fun little quiz.
This is Visual Basic 6.0. (No cheating now)
Can anyone tell me the results that will be displayed in the Immediate window when the procedure Test is called?
Public Sub Test()
Dim sTemp As String
Dim bRetVal As Boolean
sTemp = "Original"
TestFunction (sTemp)
Debug.Print "Result 1 = " & sTemp
sTemp = "Original"
bRetVal = TestFunction(sTemp)
Debug.Print "Result 2 = " & sTemp
sTemp = "Original"
bRetVal = TestFunction((sTemp))
Debug.Print "Result 3 = " & sTemp
End Sub
Private Function TestFunction(sTest As String) As Boolean
sTest = "Changed"
TestFunction = True 'Set a return value
End Function
2007-03-28
16:02:02
·
5 answers
·
asked by
Jeff R
2
in
Computers & Internet
➔ Programming & Design