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
Answers were Sorted based on User's Feedback
Answer / deepak singh
hi
Use CINT Function:: correct code is
Dim a, b, c
a =cint( inputbox("enter the a "))
b =cint( inputbox("enter the b "))
c = a + b
msgbox c
send mail if you have any query:
ccna_deepak@yahoo.com
| Is This Answer Correct ? | 21 Yes | 2 No |
Answer / rayudu
a= inputbox("Enter the value a")
b=inputbox("Enter the value b")
c=int(a)+int(b)
msgbox c
| Is This Answer Correct ? | 15 Yes | 0 No |
Answer / qa
hi
Use CINT Function:: correct code is
Dim a, b, c
a =cint( inputbox("enter the a "))
b =cint( inputbox("enter the b "))
c = a + b
msgbox c
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / 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 |
Answer / prasad v
hello
which ever the code you have written will be doing
cancatenation by accepting as characters.
if you provide inputs as a="abc" and b="xyz" then output
will be "abcxyz" right.
if you add two numbers you can go for this below code
function sum(a,b)
c=a+b
msgbox c
end function
calling the function
sum 2,3 then you will get output as 5
| Is This Answer Correct ? | 5 Yes | 6 No |
Answer / kavi
Hi,
prasad's code was right.. but we should pass values for the
function sum
dim a,b,c
function sum(a,b)
c=a+b
msgbox c
end function
x=sum(3,2)
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / ram
Dim a, b, c
a = inputbox("enter the a ")
b = inputbox("enter the b ")
c = a + b
msgbox(&c)
| Is This Answer Correct ? | 1 Yes | 7 No |
Dim ExcelSheet Set ExcelSheet = CreateObject("Excel.Application") excelsheet.application.visible = true ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1" ' Save the sheet. ExcelSheet.SaveAs "C:\DOCS\TEST.XLS" ' Close Excel with the Quit method on the Application object. ExcelSheet.Application.Quit after run this script i am getting error"The test cannot continue due to unrecoverable error"
How to export QTP results to an ".xls" file?
tell me abt a time when u had to go above &beyind the call of duty to get the job done
for a test in QTP i had choose the object repository as shared.after completion of some days i want to conduct the same test again,now the question is HOW TO LOAD THE OBJECT REPOSITORY. is it possible by descriptive programming.could any one tell me how many ways we load it and what is the process?
how i will connect oracle or microsoft acess database through manually written Script
Explain key word driven frame work?How to use in real time?
How to export QTP results to an .xls file?
I have faced one issues while doing test in QTP. I have described the scenario below. 1. I have to test web application.In that i want to give input of drop down values in the application. 2. Suppose Drop down has 5 value "A,B,C,D,E".I would like to give value from data table of QTP. 3. I have changed the drop down value as variable in Keyword view and given values in data table "A,B,C,D,E" as one below one. 4. While i am running the script it could not identify the drop down value which is in Data Table.It shows message. How to make value identify by QTP?
how to choose the framework in qtp ? 2)when we go for the descriptive programming ?
Give me detailed theritical explanation about keyword driven, hybrid framework, environment variables, hybrid frame work
In the Hybrid framework, data can access the database, excel file, XML etc. Is it true?
How does QTP identify an object?