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 are default add-ins in qtp?

14 Answers   Semantic Space,


In Remote acess server how u run a test?

0 Answers  


Explain QTP testing process?

1 Answers   Crea,


Object Repositories types, which & when to use?

3 Answers   Crea,


How does QTP identifies the object in the application?

1 Answers   Crea,






1)what is the Exact Meaning of Environment Variables? 2)what is Compile Module in QTP? what exactly it contains Functions or Actions?

4 Answers  


what is regular expression how will you implement it?

1 Answers  


str="QTP AUTOMATION TESTING" here how many T are there in the str finally i want to display the T

10 Answers   HCL,


If an application name is changing frequently i.e while recording it has name “Window1” and then while running its “Windows2” in this case how does QTP handle?

7 Answers   Covansys,


how to validate email?email ie correct or not ?with below conditions. 1)before @(symbol) only alphbates and min 4 char to max 15 chars. 2)before @(symbol) only alphabates dont use ant special chars or numarics 3) after @(symbol) only one dot(.)symbol for ex:abc@gmail.com it is valid email or not based above conditons

2 Answers   Aspire,


what does it mean when a check point is in red color? what do u do?

4 Answers  


Hi ,Can any one pleas explain how to test splash objects using QTP?

0 Answers   Value Labs,


Categories