Jump to content
Sign in to follow this  
ODell

Concatenation error

Recommended Posts

ODell

I am trying to concatenate string in a Do Until loop. I have read the help file for Concatenation and tried everything I can thing. Searched through the form and found several answers that should have workde but sill get errors. The code is:

$tempArray = StringSplit($installPath, "\")

$strPARENT = ""

For $intCounter = 0 To UBound($tempArray) - 1 Step 1

$strPARENT &= $tempArray($intCounter) & "\"

Next

And the error is:

C:\Program Files\AutoIt3\test.au3 (89) : ==> Error in expression.:

$strPARENT &= $tempArray($intCounter) & "\"

$strPARENT &= ^ ERROR

Have tried several varations of the "&" and the "&=" but no luck.

Thanks for any pointers.

Share this post


Link to post
Share on other sites
Spiff59

You've got parens around your subscript, instead of brackets.

And this line will work better for you:

For $intCounter = 1 To  $tempArray[0]

Share this post


Link to post
Share on other sites
ODell

You've got parens around your subscript, instead of brackets.

And this line will work better for you:

For $intCounter = 1 To  $tempArray[0]

Thanks another set of eyes is always helpfull.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.