hi,
i was adding the two numbers in qtp scripts but i didn't get
the answer. see my below script, i dont know wht is the problem.

i passed the value a=3 b= 2, i got the ans 32 instead of 5.
i thing the problem is to be c = a+b

my mail id karthis4u@gmail.com

Dim a, b, c
a = inputbox("enter the a ")
b = inputbox("enter the b ")
c = a + b
print c

Answer Posted / debee prasad kar

u have to use CINT function which is a conversion
function.If we not use this function then whatever we enter
in inputbox that will be treated as sting.so CINT function
converts from string to integer.
Code:
dim a,b,c
a= cint(inputbox("enter the first number"))
b= cint(inputbox("enter the second number"))
c=cint(a+b)
msgbox c

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i have to login into gmail loginpage i have to pass testcase into userid and password by using functions. the test case of user id is it should take only lowerletters alphabetin between 4 to 6 length.it should not take spectial letters.it should not take numbers.testcase for password is it should take numbers and it should not take alphabets note the following things must happen 1 when i give correct password and userid that password and userid should be seen in QTP result and notepad,xl sheet 2 when i gave in valid password the system willgive message please give valid password that particular messaage should be seen in QTP result,norepa and xl sheet

1757


How to capture dynamic values in load runner and how Each of the captured values are to be written to a text file (c:\temp\LoadRunner1.txt)

1732


Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.

1386


Explain Descriptive Programming Types with Examples?

921


Where to use function or action?

667






What is Cross browser testing? Does UFT support it?

617


Tell some commonly used Excel VBA functions?

592


Where we can use the analog mode and where we can use the low – level mode?

564


Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.

1695


What is text check point and text area check point?

602


How will you test a stapler?

592


What are the 3 main stages involved in testing with qtp?

555


How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?

3441


Plz Explain AUTOMATION REFERENCE MODEL?

1681


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

2262