Jump to content

How to check empty array entries


Ursie
 Share

Recommended Posts

  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...