# Array Item String Issue?

**URL:** <https://www.finalbuilder.com/forums/t/array-item-string-issue/4474>\
**Category:** Discussion\
**Created:** [May 25, 2011, 10:06am UTC](https://www.finalbuilder.com/forums/t/array-item-string-issue/4474 "2011-05-25T10:06:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sexy-trousers](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sexy-trousers/32/97_2.png) [@sexy-trousers](https://www.finalbuilder.com/forums/u/sexy-trousers)\
**Post date:** [May 25, 2011, 10:06am UTC](https://www.finalbuilder.com/forums/t/array-item-string-issue/4474/1 "2011-05-25T10:06:23Z")

</div>

&nbsp;If i split a string via vbscript, it throws an error when i try and read/list one of the elements values - what am I missing here (see attached project)?

TJ

[GetArrayStringIssue.atz3](https://www.finalbuilder.com/forums/uploads/default/original/2X/2/2660a23ca4a8b991017bfccd969370d2e6be74b0.atz3) (1.804 KB)

---

<div class="post-metadata">

**Author:** ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)\
**Post date:** [May 26, 2011, 1:56am UTC](https://www.finalbuilder.com/forums/t/array-item-string-issue/4474/2 "2011-05-26T01:56:27Z")

</div>

Hi TJ

The problem here was that you were performing VBScript operations on your Automise variables. This will work in some cases, but in other cases you will get strange results (as you were seeing when trying to access array elements).

The best way to approach this is to declare all the variables required for your VBScript logic inside your script action rather than creating Automise variables for this. This means that you will only require Automise variables to provide input to your script and possibly another variable for the output.

So in this case I have one Automise variable for the input (filename) and another for the output (fileversion). All the variables required to process this filename and get the version are declared within the VBScript itself (using the 'Dim' statement).

I have re-worked your project and attached it.

Hope this helps.

Regards,

Steve

[GetArrayStringIssue\_2.atz3](https://www.finalbuilder.com/forums/uploads/default/original/2X/3/312f96c43dfc1891244c45aea0353d33ecc86664.atz3) (2.274 KB)

---

<div class="post-metadata">

**Author:** ![sexy-trousers](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sexy-trousers/32/97_2.png) [@sexy-trousers](https://www.finalbuilder.com/forums/u/sexy-trousers)\
**Post date:** [May 26, 2011, 4:33am UTC](https://www.finalbuilder.com/forums/t/array-item-string-issue/4474/3 "2011-05-26T04:33:26Z")

</div>

Good to know and thanks for quick response, that makes much more sense now you've explained it...

TJ

---

<div class="post-metadata">

**Author:** ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)\
**Post date:** [May 26, 2011, 6:26am UTC](https://www.finalbuilder.com/forums/t/array-item-string-issue/4474/4 "2011-05-26T06:26:25Z")

</div>

No problems, glad to be able to help.   
  
 Regards,   
 Steve
