How to covert a String to an integer?

Answers were Sorted based on User's Feedback



How to covert a String to an integer?..

Answer / venkateshwarlu

using cint function

dim var1, var2
var1=10.89
var2=cint(var1)
msgbox var2

will give integer value : 10

Is This Answer Correct ?    11 Yes 5 No

How to covert a String to an integer?..

Answer / vulani

Here's the shortest way to do it Gents:

string mystr ("1204");
int myint;
stringstream(mystr) >> myint;

Is This Answer Correct ?    1 Yes 1 No

How to covert a String to an integer?..

Answer / varun bisaria

CInt()---> a conversion function available.

Is This Answer Correct ?    0 Yes 0 No

How to covert a String to an integer?..

Answer / bfakruddin

dim str,num
str="Hello"
num=100

cstr=cint(str) ' It converts string into integer
msgbox cstr

cint=cstr(num) ' It converts Integer into string
msgbox cint

Is This Answer Correct ?    8 Yes 14 No

How to covert a String to an integer?..

Answer / raja83

you can use cint function

cint(10) will convert integer 1

Is This Answer Correct ?    4 Yes 11 No

Post New Answer

More QTP Interview Questions

Howcan you differentiate between Exist statement, Exist property, and Exist method??? How they used???

2 Answers   IBM,


What is keyword driven testing..what is the use of this in Automated testing

2 Answers   IBM,


How to handle dynamic objects in quicktest professional?

0 Answers  


what is descriptive programming? what are the mandotory properties in qtp? what are libriry functions in qtp? what frame work you are using at your project? what is object repositery? what is our role as per qtp project is concerned as a software tester?

3 Answers   Wipro,


Waht is diff between SystemUtil.Run and invokeapplication

5 Answers  






How to create an Action Template?

1 Answers  


what is error and fault in terms of software quality?

0 Answers   TCS,


How we can add actions in the test using QTP?

4 Answers   BirlaSoft,


Did you use flatfiles in your projects?At what situation you used it?How can you upload flatfiles?

1 Answers  


hi, i am trying to capture "web element" names in a web page, and i written the code like this,, with Browser("title:=") with .page("") .webelement("htmltag:=...").getroproperty("innertext") end with end with //////////////////////////////////////////////////////////////////////////////////// QTP RETURN ERROR like this: " object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object" ok fine , i need to search another property other than "index" i use all the properties like class,text,innerhtml,innertext,visible=true,x , y,abs x ,abs y...but qtp returns error ..... in this webpage index is difficult to find? how to solve

1 Answers   IBM,


What does VBS file contain?

1 Answers  


how to test load test and block box testing an a web based application pls give ans briefly

0 Answers   Impiger,


Categories