Jump to content
Sign in to follow this  
SkeleDrew

Array Issues

Recommended Posts

SkeleDrew

If ReDim is supposed to resize an array and preserve the values, why does this example:

Dim $i[ 1 ][ 4 ]

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test",  $i[ $i[ 0 ][ 0 ] ][ 1 ] )
ReDim $i[ 2 ][ 4 ]
$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test2",  $i[ $i[ 0 ][ 0 ] - 1 ][ 1 ] )
Exit

print "1" (correct) and then terminates with:

C:\Programming\Projects\AutoIt Scripts\test.au3 (10) : ==> Array variable subscript badly formatted.:

MsgBox( 0, "Test2", $i[ $i[ 0 ][ 0 ] - 1 ][ 1 ] )

MsgBox( 0, "Test2", $i[ ^ ERROR

and also (equivalent to above):

Dim $i[ 1 ][ 4 ]

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test",  $i[ $i[ 0 ][ 0 ] ][ 1 ] )
ReDim $i[ 2 ][ 4 ]
$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test2",  "-" & $i[ 1 ][ 1 ] & "-" )
Exit

prints 1 (correct) and "--" (incorrect) instead of "-1-".

Finally, if Dim can be initialized, why does:

Dim $i[ 1 ][ 4 ] = [[ 1, 2, 3, 4 ]]

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test",  $i[ $i[ 0 ][ 0 ] ][ 1 ] )
ReDim $i[ 2 ][ 4 ]
$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test2",  $i[ $i[ 0 ][ 0 ] ][ 1 ] )
Exit

give a run error:

>Running:(3.3.4.0):C:\Development\AutoIt3\autoit3.exe "C:\Programming\Projects\AutoIt Scripts\test.au3"

C:\Programming\Projects\AutoIt Scripts\test.au3 (6) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )

^ ERROR

?

They only work in a seemingly random manner. Have been debugging for hours before finding these issues were the main setback.

Share this post


Link to post
Share on other sites
goldenix

woot soo many & so crappily written code.

Hire try this:

Dim $avArray[1][2] ;1 Row & 2 columns at the beginning ; Hire we are adding more rows

For $x = 1 To 10
    $iRow = UBound($avArray)    ;add Rows (Basically we get the size of the array hire & then we redim 1 row)
    $iCol = UBound($avArray, 2) ;Add Columns (yes we also need to redim columns cuz we have 2)

    ReDim $avArray[$iRow + 1][$iCol]    ; add more rows +1 ; ReDim $avArray[$iRow + 1][$iCol + 1] - Adds both

    $avArray[$x][0] = $x
    $avArray[$x][1] = $x
 _ArrayDisplay($avArray, "$avArray")
Next

;~ =====================================

Note that:

ReDim $avArray[$iRow + 1][$iCol + 1] ; will add 1 more row & 1 more etc up to 10
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites
SkeleDrew

woot soo many & so crappily written code.

Hire try this:

Dim $avArray[1][2] ;1 Row & 2 columns at the beginning ; Hire we are adding more rows

For $x = 1 To 10
    $iRow = UBound($avArray)    ;add Rows (Basically we get the size of the array hire & then we redim 1 row)
    $iCol = UBound($avArray, 2) ;Add Columns (yes we also need to redim columns cuz we have 2)

    ReDim $avArray[$iRow + 1][$iCol]    ; add more rows +1 ; ReDim $avArray[$iRow + 1][$iCol + 1] - Adds both

    $avArray[$x][0] = $x
    $avArray[$x][1] = $x
 _ArrayDisplay($avArray, "$avArray")
Next

;~ =====================================

Note that:

ReDim $avArray[$iRow + 1][$iCol + 1] ; will add 1 more row & 1 more etc up to 10

What do you mean by crappily written? I just did those as examples of the problems I'm facing. Wonder what you'd say if you saw the actual script I'm working on :idea: ...

Share this post


Link to post
Share on other sites
goldenix

compare your sample to my sample, Visually.

The thing is, that all I see in your example is jibberish. And I assume you also see the same thing when you look at your own code. Maybe thats the problem, try to write your code so you can actually understand whats going on. Or the problems will be pilind up 1 after another.

Anyway I felt like you were in a need of a good array example, so I posted one.

Did it solve your issue?


My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites
jchd

@SkeleDrew,

OK, I've read your examples and the behavior I observe seems fine to me.

Now what is unclear to you exactly?

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
SkeleDrew

@goldenix - Maybe it looks like gibberish because I was holding off on creating too many extra variables and reusing the few I made (at the cost of some readability). And I do understand my code (after looking at it twice) and know what's supposed to happen, just that it doesn't always happen. No it didn't solve my issue, but I have created a workaround, though a bit longer.

@jchd - The examples I posted don't work properly, at least not on my system, as shown by the accompanying results.

Share this post


Link to post
Share on other sites
jchd

Don't be so shy and explain exactly what you expect in each case and why. Then compare with what you get and draw conclusion.

You've posted precise tests cases that didn't "just happen". As you say, you've spend "some time" to come up with them. Please take just a little more time to dissect what happen.

If the light doesn't come up, we'll help.

EDIT:

Thinking twice, let me give you a hint but first try to work out by yourself what happens.

Dim $i[ 1 ][ 4 ]

; this is equivalent to

;Local $i[1][4] = [[0, 0, 0, 0]]

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )

; $i[0][0] is 0

; UBound($i) = UBound($i, 1) [default value of parameter #2] = 1

; so that's the same as:

; $i[0][1] = 1

; after that, we get that $i contains [[0, 1, 0, 0]]

MsgBox( 0, "Test", $i[ $i[ 0 ][ 0 ] ][ 1 ] )

; $i[0][0] = 0

; $i[0][1] = 1

; MsgBox displays 1, which is what we expect

ReDim $i[ 2 ][ 4 ]

; now we have $i = [[0, 1, 0, 0], [0, 0, 0, 0])

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )

; redundant assignment. $i is globally unchanged

MsgBox( 0, "Test2", $i[ $i[ 0 ][ 0 ] - 1 ][ 1 ] )

; from the inner part, $i[0][0] is 0

; $i[0 - 1][1] = $i[-1][1] causes indexing error: -1 is not in 0..UBound($i,1)

; again, this is to be expected

PS: you should upgrade to the last AutoIt release (3.3.6.1).

Running:(3.3.4.0) <<-- that's old!

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
SkeleDrew

OK these are my expactations (comments):

Dim $i[ 1 ][ 4 ]   ; create 1x4 array [ok]

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )   ; store in the last 'row' [ok]
MsgBox( 0, "Test",  $i[ $i[ 0 ][ 0 ] ][ 1 ] )   ; print what was stored [ok]
ReDim $i[ 2 ][ 4 ]   ; add another row AND preserve values present [...]
$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )   ; store in the last 'row' [...]
MsgBox( 0, "Test2",  $i[ $i[ 0 ][ 0 ] - 1 ][ 1 ] )   ; again print what's in the 1st row ($i[ 0 ][ 0 ] always returns the total rows for me), causes runtime error instead.
Exit

Dim $i[ 1 ][ 4 ]

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test",  $i[ $i[ 0 ][ 0 ] ][ 1 ] )   ; $i[ 0 ][ 0 ] should return 1 (# of rows).
ReDim $i[ 2 ][ 4 ]
$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test2",  "-" & $i[ 1 ][ 1 ] & "-" )   ; $i[ 1 ][ 1 ] should return what's in row 1, ie, the same thing printed in the 1st MsgBox.
Exit

Dim $i[ 1 ][ 4 ] = [[ 1, 2, 3, 4 ]]   ; should initialize the array but crashes the script instead.

$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test",  $i[ $i[ 0 ][ 0 ] ][ 1 ] )
ReDim $i[ 2 ][ 4 ]
$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
MsgBox( 0, "Test2",  $i[ $i[ 0 ][ 0 ] ][ 1 ] )
Exit

I've also noticed that some of the crazier errors that I've gotten can be fixed at times by inserting a delay (sleep or beep) between related statements. Seems to me there're some background overhead to some statements or something, and it's throwing my script off, which is time critical...

Share this post


Link to post
Share on other sites
jchd

You are really misunderstanding AutoIt arrays. Go read my spoiler, then follow AdmiralAlkex advice. Doing so early will save you _much_ time and effort in misguided attempts.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
Tvern

crap.. for some reason I didn't read the last posts which made my answer pretty much redundant.

one piece of advise though.

When you are getting unexpected results with arrays, you can use _ArrayDisplay() to get good idea of what is happening inside your array.

Don't forget to #include<array.au3> at the top of your script!

Example:

#include<array.au3>
Dim $i[ 1 ][ 4 ]
_ArrayDisplay($i,"empty 1x4 array")
$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
_ArrayDisplay($i,'"1" stored in $i[0][1]')
MsgBox( 0, "Test", $i[ $i[ 0 ][ 0 ] ][ 1 ] )
ReDim $i[ 2 ][ 4 ]
_ArrayDisplay($i,'array resized to 2x4, value preserved in $i[0][1]')
$i[ $i[ 0 ][ 0 ] ][ 1 ] = UBound( $i )
_ArrayDisplay($i,'"2" stored in $i[0][1]')
MsgBox( 0, "Test2", $i[ $i[ 0 ][ 0 ] - 1 ][ 1 ] )
Exit
Edited by Tvern

Share this post


Link to post
Share on other sites
jchd

Yes Tvern, but displaying the guts of an array even with high-tech hyper frequency scanner won't make illegal indexing legal, so the script 1 & 3 wil keep on reporting errors. X-ray is fine but the problem is mixing live patient with dead beef. That can only be overcome by learning how AutoIt array work: zero-based and Ubound to query dimensions.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
Tvern

Yeah my original reply did address the 0 bases aspect, but then I realised it had all been said in your previous post, so I removed all but the advise to check an arrays when you run into problems.

Share this post


Link to post
Share on other sites
SkeleDrew

I hear what you're all saying, but I've found a workaround to my issues. My script's working fine now. Maybe I should stick to the C family. Never had those kinds of issues with them...

Got another issue with a previous script though, and I really don't think I've done anything wrong here. This is one of the functions in a script I use to monitor my system:

Func FixPos( $val1, $val2, $val3 )
    ; check window position and change if different
    If WinActive( $val1 ) Then
        $wint = WinGetTitle( "[active]" )
        Sleep( 250 )
        $tmp = WinGetPos( $wint )
        Sleep( 250 )

        If $tmp[ 0 ] <> $val2 Or $tmp[ 1 ] <> $val3 Then
            ; position mismatch
            BlockInput( 1 )
            WinMove( $wint, "", $val2, $val3 )
            BlockInput( 0 )
        EndIf
    EndIf
EndFunc

And after running properly for a few seconds/minutes/hours, it'll just randomly give a runtime error:

C:\Programming\Projects\AutoIt Scripts\taskman.au3 (206) : ==> Subscript used with non-Array variable.:

If $tmp[ 0 ] <> $val2 Or $tmp[ 1 ] <> $val3 Then

If $tmp^ ERROR

As I've noticed before, putting a Sleep delay between certain key areas fixes some of the problems somewhat, but the script is a time critical one (and I've wasted 1/2 second in just this function), and there're many functions to cycle through, with more being added as I think of things I want to automate.

Share this post


Link to post
Share on other sites
jchd

I hear what you're all saying, but I've found a workaround to my issues. My script's working fine now. Maybe I should stick to the C family. Never had those kinds of issues with them...

Replace "workaround" by "correction"! Everything you've posted so far had conceptual problems with 0-based arrays.

BTW, C arrays are zero-based as well, so I hardly get your point. If you don't get it in C, you're likely to overwrite something and corrupt innocent data, or get a nice exception. The only difference with AutoIt is that it signals the error nicely.

Got another issue with a previous script though, and I really don't think I've done anything wrong here. This is one of the functions in a script I use to monitor my system:

And after running properly for a few seconds/minutes/hours, it'll just randomly give a runtime error:

That means that

$tmp = WinGetPos( $wint )

didn't return an array, i.e. that WinGetPos returned an error.

There is no error checking at all in you code, so don't be surprised it doesn't always behave the way you expect.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
SkeleDrew

Replace "workaround" by "correction"! Everything you've posted so far had conceptual problems with 0-based arrays.

BTW, C arrays are zero-based as well, so I hardly get your point. If you don't get it in C, you're likely to overwrite something and corrupt innocent data, or get a nice exception. The only difference with AutoIt is that it signals the error nicely.

Actually I do mean workaround. Instead of ReDimming to resize the array and risk losing the previous info, I appended the info in a single string and StringSplitted it :idea: . And AutoIT isn't 0-based, else the actual data (and not the array size) would start from position 0.

That means that

$tmp = WinGetPos( $wint )

didn't return an array, i.e. that WinGetPos returned an error.

There is no error checking at all in you code, so don't be surprised it doesn't always behave the way you expect.

And my question to that is why didn't return the array it's supposed to? I don't error check code that's supposed to be fool-proof. If a snippet works under a certain condition, it should ALWAYS work in that condition, not give random runtime errors. There's NOTHING to cause an invalid window to be SOMETIMES given by WinGetPos( $wint ). But I have added a bit of error checking (and thus more overhead), to hopefully placate the goddess of whim that affects AutoIt's consistency...

Func FixPos( $val1, $val2, $val3 )
    ; check window position and change if different
    If WinActive( $val1 ) Then
        $wint = WinGetTitle( "[active]" )
        $val1 = _Timer_Init()

        Do
        $tmp = WinGetPos( $wint )
        UBound( $tmp )   ; ensure an array was made
        Until @error = 0 Or _Timer_Diff( $val1 ) > 1000

        If $tmp[ 0 ] <> $val2 Or $tmp[ 1 ] <> $val3 Then
            ; position mismatch
            BlockInput( 1 )
            WinMove( $wint, "", $val2, $val3 )
            BlockInput( 0 )
        EndIf
    EndIf
EndFunc

If this craziness keeps up, I'll have to ditch AutoIt like I did QBasic, which showed it's limitations too the more complex the stuff I gave it.

Share this post


Link to post
Share on other sites
jchd

Like it or not, AutoIt arrays are zero-based. What that means is that

Local $a[2]

has two elements referenced by $a[0] and $a[1]

Point. You may feel that this behavior departs from C (which does exactly the same, btw) but nobody here seriously cares.

Array dimensions are queried by UBound(), as documented. Up to 64 dimensions are allowed. Your "usage" of UBound in the code posted above shows that you're incapable of reading the documentation!

Then you're confusing the fact that arrays are zero-based and the fact that some UDF functions return a number of elements in the index 0 entry. That is the privilege of UDF (= user defined function) to specify a behavior like this. If that doesn't suit you (again), you're still free to leave those functions alone and write your own.

ReDim doesn't loose information contrary to your belief.

Finally if you believe that, contrary to experience, no error may ever occur in your code, that your code is way too correct to sacrify to any basic error checking, then you're likely to be severely disappointed by _any_ programming language. All this if, of course, you use the functions correctly after having studied their description.

There's NOTHING to cause an invalid window to be SOMETIMES given by WinGetPos( $wint )

You're kidding, aren't you?

You see, people here have writen large if not huge applications in AutoIt without complaining about craziness. You come here and keep on spouting nonsense without ever reading the documentation. That alone speaks against any "issue" (or non-issue) you believe having.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
AdmiralAlkex

@jchd

Good said!

@SkeleDrew

Go read the array tutorial. You need it!

You need to start reading the helpfile too, your issue with WinGetPos() is just ridiculous.

Why don't you put in some basic error-checking so you know if it's WinGetPos() or WinGetTitle() that fails? I mean, what is WinGetPos() supposed to do with a ZERO as title?

Also you need to get rid of the Timers.au3, TimerInit() and TimerDiff() is native so there's no need to bloat your script like that!

And to check if a variable is an array you use IsArray(). UBound() is to get the size!

Share this post


Link to post
Share on other sites
jchd

Sorry but that started to put me a little on the nerves. I and others kept pointing out his/her misconceptions (and I even took the pain to hint in detail toward explanation of the observed issue the OP had) but he/she kept ignoring that and instead complains about something else with off the mark arguments, misunderstanding and ignorance of the reference docs, so...

:idea:


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
SkeleDrew

I know I must be getting pretty frustrating now, and I admit I've been ignoring the array tutorial a bit, but looking at the issue, how can WinGetTitle() return zero when the function reference says:

Remarks

WinGetTitle("[active]") returns the active window's title. WinGetTitle works on both minimized and hidden windows. If multiple windows match the criteria, the most recently active window is used.

Anyhow, I've bypassed that with a premature Return when it gets an invalid value. I have thought of something though. Since the function works on minimized windows, maybe it ran into an active one that's GETTING minimized and crashes there :idea: ...

And I just used UBound() as a quick and dirty way to check for an array. Somewhat unintuitive, but it works :) .

EDIT: BTW, what's the difference between _Timer_Init() and TimerInit()? I don't see anything extra features in the former.

Edited by SkeleDrew

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.