Jump to content

2 funcs


Gif
 Share

Recommended Posts

  • Developers

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?

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

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

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...