ReaImDown Posted December 5, 2007 Share Posted December 5, 2007 I am trying to see if $Array[5] = "" or if it = something else, so this is what I have if $Array[5] <> "" then msgbox(0,"",$Array[5]) Else Msgbox(0,"","Array Not Complete") Endif Whats wrong with it? lol [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Generator Posted December 5, 2007 Share Posted December 5, 2007 Try this? If String($Array[5]) <> "" then msgbox(0,"",$Array[5]) Else Msgbox(0,"","Array Not Complete") EndIf Link to comment Share on other sites More sharing options...
ReaImDown Posted December 5, 2007 Author Share Posted December 5, 2007 Try this? If String($Array[5]) <> "" then msgbox(0,"",$Array[5]) Else Msgbox(0,"","Array Not Complete") EndIf Line -1: Error: Subscript used with non-Array variable. (BTW, the array is declared at the start of the file, and the IF statement is placed inside a function) [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
ReaImDown Posted December 5, 2007 Author Share Posted December 5, 2007 Also, "Array[5]" May Not EXIST, [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
aslani Posted December 5, 2007 Share Posted December 5, 2007 (edited) nvm Edited December 5, 2007 by aslani [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
ReaImDown Posted December 5, 2007 Author Share Posted December 5, 2007 nvm #include<Array.au3> Dim $Array[1] _ArrayAdd($Array, "1") _ArrayAdd($Array, "2") _ArrayAdd($Array, "3") _ArrayAdd($Array, "4") If $Array[5] Then If String($Array[5]) <> "" Then MsgBox(0,"",$Array[5]) Else MsgBox(0,"","Array Not Complete") EndIf Else MsgBox(0, "Error", "$Array[5] doesn't exist") EndIf Line 10 (File "C:\Documents and Settings\Elizabeth\Desktop\New AutoIt v3 Script.au3"): If $Array[5] Then If ^ ERROR Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded. [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
aslani Posted December 5, 2007 Share Posted December 5, 2007 Ok try this; (my previous post was not tested, sorry, but this one is) If Ubound($Array)-1 = 5 Then ;Checks for $Array[5] If $Array[5] <> "" Then MsgBox(0,"",$Array[5]) Else MsgBox(0,"","Array Not Complete") EndIf Else MsgBox(0, "Error", "$Array[5] doesn't exist") EndIf [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now