Jump to content

Array to String not working. Whats wrong? Help asap if possible, thx


CrewXp
 Share

Recommended Posts

$cxpcommand = StringSplit($msg, ' ', 1)

GLOBAL $sArrayString = _ArrayToString($cxpcommand,-1,-1," ")

MsgBox( 4096, "_ArrayToString() Test", $sArrayString )

I'm leaving the room right now, but all I can say right now is that doesn't work. It shows a blank box. What's wrong? Thx brb

Link to comment
Share on other sites

Im back. Even when I try the autoit help example, the msgbox still has nothing in it.

#include <Array.au3>

Dim $avArray[11], $I = 0

; Populate test array.
For $I = 0 to UBound( $avArray ) - 1
    $avArray[$I] = Int( Random( -20000, 20000 ) )
Next

_ArrayDisplay( $avArray, "_ArrayToString() Test" )

Dim $sArrayString = _ArrayToString( $avArray, 1, 7, @TAB )
MsgBox( 4096, "_ArrayToString() Test", $sArrayString )
Exit

Thx

Link to comment
Share on other sites

The help file example works for me. I am using the latest Beta on Win XP sp2.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

The example in the help file worked for me as well. Win2k using Autoit v3.1.1

However your example, and the example in my help file are different.

#include <Array.au3>

Dim $avArray[11], $I = 0

; Populate test array.
For $I = 0 to UBound( $avArray ) - 1
    $avArray[$I] = Int( Random( -20000, 20000 ) )
Next

_ArrayDisplay( $avArray, "_ArrayToString() Test" )

Dim $sArrayString = _ArrayToString( $avArray, 1, 7, @TAB )
MsgBox( 4096, "_ArrayToString() Test", $sArrayString )
Exit

#include <Array.au3>

Dim $avArray[11], $I = 0

; Populate test array.
For $I = 0 To UBound($avArray) - 1
    $avArray[$I] = Int( Random(-20000, 20000))
Next

_ArrayDisplay($avArray, "_ArrayToString() Test")

Dim $sArrayString = _ArrayToString($avArray, @TAB, 1, 7)
MsgBox(4096, "_ArrayToString() Test", $sArrayString)
Exit
Note the line: Dim $sArrayString = _ArrayToString($avArray, @TAB, 1, 7)

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

The example in the help file worked for me as well. Win2k using Autoit v3.1.1

However your example, and the example in my help file are different.

Note the line: Dim $sArrayString = _ArrayToString($avArray, @TAB, 1, 7)

actually, i'm almost positive that i remember this coming up before, that parameters were in wrong order in an older helpfile. i believe that they corrected it. i'll see if i can't find a link to that thread and edit it in here...

***edit***

found it. in the list of changes...

Edited by cameronsdad
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
 Share

  • Recently Browsing   0 members

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