PerryRaptor Posted February 6, 2007 Share Posted February 6, 2007 I'm parsing an EditBox on an IM program stuffing arrays and sniffing array elements for particular strings. I've run into a problem, I do not know what an empty element is equal to. _ArrayDisplay shows nothing for $array nor does MsgBox show anything for $array[3]. I've tried IF $array[3] == ' ' Then I've tried IF $array[3] == " " Then I've tried IF $array[3] == 0 Then Link to comment Share on other sites More sharing options...
/dev/null Posted February 6, 2007 Share Posted February 6, 2007 I'm parsing an EditBox on an IM program stuffing arrays and sniffing array elements for particular strings. I've run into a problem, I do not know what an empty element is equal to. _ArrayDisplay shows nothing for $array nor does MsgBox show anything for $array[3]. I've tried IF $array[3] == ' ' Then I've tried IF $array[3] == " " Then I've tried IF $array[3] == 0 Then Dim $a[2] ;$a[0] = 1 If $a[0] == '' Then MsgBox(0,"","EMPTY") EndIf __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
PerryRaptor Posted February 6, 2007 Author Share Posted February 6, 2007 (edited) that will not workThis is what _ArrayDisplay() shows:[0] = 2[1] = element1[2] = element2[3] = What is [3] = to?What I need is something like IF $array[3] is empty THEN ... Edited February 6, 2007 by PerryRaptor Link to comment Share on other sites More sharing options...
Achilles Posted February 6, 2007 Share Posted February 6, 2007 (edited) Msgbox(0, '', "|" & $array[3] & "|") The "|"'s are so you can see if the array value is nothing... Edited February 6, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
/dev/null Posted February 6, 2007 Share Posted February 6, 2007 (edited) that will not work Sure it will work, that's why I posted the code! This is what _ArrayDisplay() shows: [0]= 2 [1] = element1 [2] = element2 [3] = What is [3] = to? Either empty (see my code) or not printable, try MsgBox(0,"",String($a[3])). Edited February 6, 2007 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
PerryRaptor Posted February 6, 2007 Author Share Posted February 6, 2007 Piano Man's trick worked IF $array[3] == "" Then ... so an empty element is equal to "" ; no space between double quotes. Thanks guys Link to comment Share on other sites More sharing options...
/dev/null Posted February 6, 2007 Share Posted February 6, 2007 Piano Man's trick worked IF $array[3] == "" Then ... so an empty element is equal to "" ; no space between double quotes. Thanks guys So, what did I post? You did not even care to test it, right? __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
xcal Posted February 6, 2007 Share Posted February 6, 2007 (edited) Piano Man's trick worked IF $array[3] == "" Then ... so an empty element is equal to "" ; no space between double quotes. Thanks guys No trick involved. You were checking for a space character or a number. Edited February 6, 2007 by xcal How To Ask Questions The Smart Way 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