Jump to content

change stringsplit array

Recommended Posts

You cannot assign new value like that.  You can retrieve it with the way you use, but cannot set it.

One way :

#include <array.au3>

Global $Data[2]
Global $test[2] = ["hello,test,yes","no,bu,zam,xod"]

For $n = 0 To 1
  $Data[$n] = StringSplit($test[$n],",")

SetArray($data[1], 1, "gar")

Func SetArray (ByRef $aArr, $iIdx, $vVal)
  $aArr[$iIdx] = $vVal


Link to comment
Share on other sites

Pretty sure this is a bug.

Assigning a value to expression should return an error, lest one think that some variable is actually being modified somewhere.

In its purest form it doesn’t even involve arrays, for instance:

Local $a=1, $b=2

($a) = $b


The second statement should throw an AutoIt error, something to the effect of 

Cannot assign value to an expression.


Code hard, but don’t hard code...

Link to comment
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...