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

What is object repository?

3 Answers  


How i can use and create Library functions in QTP and what is the proces .

2 Answers  


Could anyone please tell me one situation where you have used recovery scenarion in real time with an example?

4 Answers  


Explain the concept of object repository and how quicktest professional (qtp) recognises objects?

0 Answers  


How to "Turn Off" QTP results after running a Script?

4 Answers  


In a QTP project lets say there are 100+ function library and incorrectly we have duplicate some function in multiple libraries. How to find those duplicate functions and remove them?

1 Answers  


How to check the value for variables during run time. Pls anybody can give the answer.. Thanks in advance...

4 Answers   Navis,


How to do excception handling ( error handling ) in QTP

6 Answers   Institute for Medical Education,


We have a text file which contains 1 to 100 numeric values sequentially like 1 2 . . 100 Now we have to count them and transfer to XML file by writing a code in qtp.

1 Answers   Cap Gemini,


How does Parameterization and Data-Driving relate to each other in QTP?

2 Answers  


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)

0 Answers   TCS,


There is an excel file of 1 to 100 sheets how you will iterate through it?

0 Answers  


Categories