Sign in to follow this  
Followers 0
cookiemonster

ArrayToString only row 0

7 posts in this topic

Im trying take the first row of my array and put it in a variable:

When I run the following it gives me the full array in a string, not just row 0

$default = _ArrayToString($rFileList, "", 0, 0)

But when I run it for row 1, then it give me only row 1

$default = _ArrayToString($rFileList, "", 1, 1)

Why cant I put row 0 into a string? why does it return the full array into the string?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

How does your array $rFileList look like?

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

$rFileList is an array, so for example:

Row|Col 0 [0]|000 - aaa [1]|000 - bbb [2]|000 - ccc

Share this post


Link to post
Share on other sites

Are you trying to take a 1 dimensional array and use the 0 row variable?  If so, just

$var = $rFileList[0]

I would assume _ArraytoString would work with 0 as start and 0 as end, but as you indicated giving it 0 , 0 returns the full string deliminated value of the array, not just row 0

If you aren't using a 1 dim array respond back, you can't use arraytostring with 2 dim arrays anyway, but I can give an example if your confused.


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The _ArrayToString() interprets the 0 for the end bound differently. That means 0 gets all values -> 0, 0 is not possible to get only array[0].

For array[0] you have to do it manually.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

that looks terrible

Row|Col 0

[0]000 - aaa

[1]|000 - bbb

[2]|000 - ccc 

thats what it looks like

Share this post


Link to post
Share on other sites

'Someone' that worked brilliantly, dont know why i didnt think of that... im always trying to overcomplicate things! cheers

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  
Followers 0