Micro Focus QTP (UFT) Forums
Query regarding "Call" statement - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Query regarding "Call" statement (/Thread-Query-regarding-Call-statement)



Query regarding "Call" statement - anupam4j - 09-26-2014

The following piece of code gives an output value 10 :

Code:
Function FinalVal( ByRef var )
    var = var + 1
End Function

Dim x: x = 10
FinalVal(x)
MsgBox x
'--------------------------

But the following code gives an output value 11 :

Code:
Function FinalVal( ByRef var )
    var = var + 1
End Function

Dim x: x = 10
call FinalVal(x)

MsgBox x
'----------------------------

Its clear that the use of the "Call" statement is the reason behind the difference in the output.
But why does that happen?


RE: Query regarding "Call" statement - vinod123 - 09-26-2014

what is the scenario you are working so that i can suggest you another way