Jump to content
Sign in to follow this  
natthehe

Same-named windows and arrays

Recommended Posts

natthehe

I'm stuck with this really annoying problems that i really cant figure out.

The first one is Dim and strings

Dim $test[1]

$test['StringFormatedArray'] = 'This is a string which should be called by a STRING and not 0'

$test[1] = '0x82172'

$test[0] returns $test[1] (last object) while $test[1] still shows 0x82172.

What am i doing wrong in this case when i just want the array called by a text instead of a number like PHP

$stuff = array('StringFromatedArray' => 'This is a string which should be called by a STRING and not 0', 1 => '0x82172')

And the other thing that bugs me is when i want to control multiply same-named windows (move\get) something from them. I really cant figure it out how im supposed to do... Tried something similar to this:

$q = winlist()

for $i=1 to $q[0][0]

if $q[$i][0] = 'my window' then

;Lots of code and a box asking if its the correct window, if its not then the search should continue. if its the right one it should get information about it

WinGetProcess($q[$i][0])

;else exitloop!

endif

next

Share this post


Link to post
Share on other sites
AdmiralAlkex

Oh come on, nothing of that made any sense at all.

1.

Dim $test[1]

You create a array with one (1) element.

$test['StringFormatedArray'] = 'This is a string which should be called by a STRING and not 0'

What does the helpfile say about arrays?

An Array is a variable containing series of data elements of the same type and size. Each element in this variable can be accessed by an index number.

Nothing about any "associative array" support. But you're lucky, there are UDF's for that, search the forum.

$test[1] = '0x82172'

$test only have 1 element, and arrays starts at zero, so that will obviously not work.

There's a array tutorial on the wiki, I suggest you study it.

2.

You shouldn't use titles, use the handles. They are unique.

$array[0][0] = Number of windows returned

$array[1][0] = 1st window title

$array[1][1] = 1st window handle (HWND)

Good luck with your future endeavours! :D

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites
natthehe

Oh come on, nothing of that made any sense at all.

1.

Dim $test[1]

You create a array with one (1) element.

$test['StringFormatedArray'] = 'This is a string which should be called by a STRING and not 0'

What does the helpfile say about arrays?

Nothing about any "associative array" support. But you're lucky, there are UDF's for that, search the forum.

$test[1] = '0x82172'

$test only have 1 element, and arrays starts at zero, so that will obviously not work.

There's a array tutorial on the wiki, I suggest you study it.

2.

You shouldn't use titles, use the handles. They are unique.

Good luck with your future endeavours! :D

it didnt? okay ill try explain again

#include 'array.au3'

dim $sense[3]
$sense['first'] = 'this'
$sense['second'] = 'make'
$sense['seriously'] = 'no'
$sense['sense'] = 'at all'

MsgBox(0,'With this box i want to show MAKE from $sense[SECOND]',$sense['second']&@CRLF&'oooh nvm at all will show right?')
_ArrayDisplay($sense)
Sleep(100000)

2. thanks!

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  

×