Sign in to follow this  
Followers 0
Ursie

How to check empty array entries

5 posts in this topic

What is the best wayt to check for an empty array entry.

I tried to use "If array[3][8] = "" Then array[3][8] = _NowCalc ()"

But that doesn't work somehow

What method i need to use then ?

Thnx for the help in advance

Share this post


Link to post
Share on other sites



What is the best wayt to check for an empty array entry.

I tried to use "If array[3][8] = "" Then array[3][8] = _NowCalc ()"

But that doesn't work somehow

What method i need to use then ?

Thnx for the help in advance

Should work...assuming you are putting a $ in front of Array.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Oh yeah sorry about the missing $ :)

But i can tell you that it doesn't work.

I even tried Msgbox ( 0 , "DEBUG" , "|" & $array[3][8] & "|" )

And that show to me as ||

So i don''t know what is going wrong here.

Well it is most probarly my little brain that is causing the problem then :P

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Oh yeah sorry about the missing $ :)

But i can tell you that it doesn't work.

I even tried Msgbox ( 0 , "DEBUG" , "|" & $array[3][8] & "|" )

And that show to me as ||

So i don''t know what is going wrong here.

Well it is most probarly my little brain that is causing the problem then :P

Yes it does.. here is a simple example to demonstrate it works:

Dim $array[5]
$array[0] = "A"
$array[2] = "C"
$array[4] = "E"
For $x = 0 to 4
    If $array[$x] = "" then MsgBox(0,"demo","Array entry is empty:" & $x)
Next
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Oh yeah sorry about the missing $ :)

But i can tell you that it doesn't work.

I even tried Msgbox ( 0 , "DEBUG" , "|" & $array[3][8] & "|" )

And that show to me as ||

So i don''t know what is going wrong here.

Well it is most probarly my little brain that is causing the problem then :D

If $array[3][8] = '' Then what do you expect to see as a return?

Local $array[4][9]
$array[3][8] = 'Something'
MsgBox(0, 'Debug', '|' & $array[3][8] & '|');Should be |Something| as a value
$array[3][8] = ''
MsgBox(0, 'Debug', '|' & $array[3][8] & '|');should be || as a value
I like Jdebs example explaining it better though :P

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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