Sign in to follow this  
Followers 0
Gif

2 funcs

7 posts in this topic

#1 ·  Posted (edited)

Are there any functions, in autoit, alike to IsNull() or LBound()?

Edited by Gif

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Ok got it, how about IsNull()? (basicly checks for invalid content in a variable)

Edited by Gif

Share this post


Link to post
Share on other sites

Ok got it, how about IsNull()? (basicly checks for invalid content in a variable)

Do you have an example were you can use it in AutoIt3 syntax?

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

#5 ·  Posted (edited)

For $Obj_Items In $Col_Items
    Local $IntFreeSpace = $Obj_Items.FreeSpace
    If ((String($IntFreeSpace) == '') Or (Number($IntFreeSpace) = 0)) Then ; IsNull() check should be here
        Local $m_Text = 'No disk in floppy drive.'
    Else
        Local $m_Text = 'Disk found in the floppy drive.'
    EndIf
Next

The Null value indicates that the variable contains no valid data. Null is not the same as Empty, which indicates that a variable has not yet been initialized. It is also not the same as a zero-length string (""), which is sometimes referred to as a null string.

I know it's not THAT important but sometimes it might be needed for better coding. Edited by Gif

Share this post


Link to post
Share on other sites

For $Obj_Items In $Col_Items
    Local $IntFreeSpace = $Obj_Items.FreeSpace
    If ((String($IntFreeSpace) == '') Or (Number($IntFreeSpace) = 0)) Then ; IsNull() check should be here
        Local $m_Text = 'No disk in floppy drive.'
    Else
        Local $m_Text = 'Disk found in the floppy drive.'
    EndIf
Next

I know it's not THAT important but sometimes it might be needed for better coding.

If Not $IntFreeSpace Then ....

An empty string and 0 both test as false.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

An empty string and 0 both test as false.

The way you said that made me remember there are a lot of kinds of nothing.

0
"0"
""
Chr(0)
NULL
Empty
Nothing
Edited by Manadar

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