Forum Discussion

raynjay's avatar
raynjay
Occasional Contributor
8 years ago

How to convert Object to String

 

Hi,

 

I want to convert object to string like from a object,'Regions.Image1' to string 'Regsions.Image1'.

My developed JScript function is required an image stored to Regions as input parameter.

The string could be entered as input parameter but user have to remember whole object aliases and it could

make invalid input error.

So, I'd like to convert from object to string and use it.

 

If anyone has a good idea, please let me know.

 

Thanks,

Raymond.

 

 

 

2 Replies

  • Use Testcomplete Function below

     

    aqConvert.VarToStr(V)

     

    it will output as string()

     

    OR

     

    in javascript you can use toString() function

     

    Regards,

    Karthick Raj P

  • shankar_r's avatar
    shankar_r
    Community Hero

    If my understanding is correct, you are expecting to get the object name ryt?

     

    So, if that is then

     

    Let's say you have object like below and if you want the entire name send to into a function then you can use below code

     

    Aliases.homePane.txt_UserName.MappedName it will return as "Aliases.homePane.txt_UserName"