Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumTesting Tools @ OneStopTestingQuickTest Pro @ OneStopTesting

Message Icon Topic: Passing by value vs Passing by reference

Post Reply Post New Topic
Author Message
Mithi25
Senior Member
Senior Member
Avatar

Joined: 23Jun2009
Online Status: Offline
Posts: 288
Quote Mithi25 Replybullet Topic: Passing by value vs Passing by reference
    Posted: 22Sep2009 at 2:20am

Passing by value vs Passing by reference

Here is a QTP quiz for you. We have two functions below. For the first one, argument is passed by reference while for the second, argument is passed by value.

A. Argument is passed by Reference

Function learnqtp( ByRef var)

    myname= "jain"

    msgbox var

    msgbox myname

End Function

myname= "ankur"

call learnqtp (myname)

B. Argument is passed by Value:

Function learnqtp( ByVal var)

    myname= "jain"

    msgbox var

msgbox myname

End Function

myname= "ankur"

call learnqtp (myname)

Without copying the functions in your QTP editor, try to find:

  1. Output of A.
  2. Output of B.

Why do you think output differ/doesn’t differ? Give your answers in comment below. Now, open QTP and check your answers. Any more comments? :%29





Edited by Mithi25 - 22Sep2009 at 2:21am



Post Resume: Click here to Upload your Resume & Apply for Jobs

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 5.516 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting