Jump to content

Recommended Posts

Posted

#Include <Array.au3>

Local $Array[ 3 ] = [1,2,3]

_ArrayToString(_ArraySort($Array))

C:\Documents and Settings\Administrator\Desktop\afrarg.au3(5,34) : ERROR: _ArrayToString() called with exp<b></b>ression on Const ByRef-param(s).
_ArrayToString(_ArraySort($Array))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Program Files\AutoIt3\Include\Array.au3(1243,81) : REF: definition of _ArrayToString().
Func _ArrayToString(Const ByRef $avArray, $sDelim = "|", $iStart = 0, $iEnd = 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Posted (edited)

On success, _ArraySort() returns 1. Basically you are stating ArrayToString(1)

Maybe...

#include <Array.au3>
Local $Array[4] = [1, 4, 2, 3]
_ArraySort($Array)
$string = _ArrayToString($Array, ",")
MsgBox(4096, "String", $string)

8)

Oh DUH! Thanks Valuator...

Any reason why it returns a 1 and not a sorted array?

Oh because the array is passed ByRef and therefore it sorts the array in place?

Edited by jaberwocky6669

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...