Select Page

A2019 loop with string possible?

Home Automation Forum Robotic Process Automation Automation Anywhere A2019 loop with string possible?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #227815
    Anonymous
    Inactive

    Similar to my question about using numbers in a path, are we able to convert a string to a number and loop for n times?

    I thought I could convert the string with a toNumber(), but it doesn’t work.

    #227819
    Anonymous
    Inactive

    You can definitely use a String variable as your counter in A2019 (and do it easily with the right browser).  Here’s an example where I’m doing it:

    A2019 Convert String to Number in a Loop

    It won’t let you pick Strings from a list of your variables if you hit F2 as you normally would because it’s explicitly looking for a number (as indicated with ‘#’ symbol on the left side of the box).  That being said, if you put a dollar sign, it will let you pick from your entire list of variables, both system variables and ones you’ve created.  After picking your String, you can use dot notation before the closing ‘$’ of your variable name, and it will let you convert via a ‘String:toNumber‘ function.

    NOTE:  Using the dollar sign to pick from all variables and using the dot notation function calls work best in Chrome!  They basically don’t work at all in IE (as of this writing), and you’ll get mixed results in Edge (I think you get dot notation but not the variables list, if I remember correctly).

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.