X=10,Y=20 you need to swap the numbers without using a
third variable?

Answer Posted / ramyashetty

'a and b are two variables ; Following code swaps both number and string inputs

a = Inputbox("Enter a")
b = Inputbox("Enter b")


a = a + b

b = left(a,(instr(a,b)-1))
a = Right(a,(len(a)-len(b)))

msgbox "b ="&b
msgbox "a = "&a

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you handle exceptions in qtp?

536


when will you do debug your script? and explain that process?

1453


in qtp 3 sheets is there in data table like global, action1, action2. I want to check the rows and columns in action2. how can check using script?

6329


Some time when i wanna learn the object i face issue like i am not able learn the object in proper manner... eg:for text bo on web page it should learn as webedit but some times it reads as winobject:internetexpoler-server, because of this i have to uninstall the qtp and re-install it again when i do this it reads the object perfectly.....plz suggest the soln

1397


how can we compare descriptive programing with a regular expression

1925






To retrive the test data which tool vl use and whats basis u vl write test data? its urgent

1446


Functions call by reference and call by value. i want the diff b/n these 2 and how will be the script for this?in which situation we use these 2..?pls explain me clearly

1253


How to modify the text checkpoint?

616


1--How many functions u develop 2--What is an array 3-- where is ur server 4--U involved in unit testing 5--how ur test the background colour using QTP

1545


What is an expert view and keyword view?

572


What is exact meaning of Database Checkpoint in QTP 9.2 and what are the different types of the database check points?

2267


What do you mean by checkpoints in qtp?

561


When you open QTP, how many sheets you can see?

664


How to use transactions in qtp?

565


I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.

1517