Forum Discussion

jyothi_priya's avatar
jyothi_priya
Contributor
14 years ago

How to convert a string stored in a variable into an integer

Hi,



I want to convert a string stored in a variable into an integer.

For eg I want to perform follwing operation:

            X = object.Text            'X = 5000 

            Y = X + 1



here X need to be converted to integer. i have tried following options but isn't working for me:

   

     aqConvert.StrToInt(X)

    

    aqConvert.VarToInt(X)

    

    VarToInteger(X)

    

    X1 = BuiltIn.VarToStr(X)

    X2 = Utilities.StrToInt(X1)



Can anyone give em a solution for this...



Thanks Priya

1 Reply

  • Hi,



    You need to use the aqConvert.StrToInt method to convert a string to an int.

    Can you explain how exactly this conversion method 'isn't working' for you? Do you get errors?