Jump to content

vbs keyword (nothing)


Xink
 Share

Recommended Posts

Hello,

I have a small vbs which i have already converted to autoit script.

Everything is converted except the keyword Nothing in vbs.

Is there a similar function in Autoit for the keyword Nothing in vbs?

thanks in advance,

Xink

Link to comment
Share on other sites

  • Moderators

Hello,

I have a small vbs which i have already converted to autoit script.

Everything is converted except the keyword Nothing in vbs.

Is there a similar function in Autoit for the keyword Nothing in vbs?

thanks in advance,

Xink

Did you try something like:

(assuming the vbs syntax looks something like)

set var = Nothing
To
var = ''
?

Mind you, I'm no VB person, I just started playing with it the other day thanks to KandieMan (don't know if that's a good thing yet :lmao: )

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

Is there a similar function in Autoit for the keyword Nothing in vbs?

AutoIt does not have a keyword same as VBScript's Nothing.

@SmOke_N, Nothing and "" are different. Nothing erases the variable itself. :lmao:

VBScript example:

Dim var

' Assign "" to var
var = ""

' Set to Nothing
Set var = Nothing

' Now Nothing equals an undeclared var and an error will occur
msgbox var
Link to comment
Share on other sites

AutoIt does not have a keyword same as VBScript's Nothing.

@SmOke_N, Nothing and "" are different. Nothing erases the variable itself. :lmao:

So there is no command in autoit to check/reset the variable to nothing?

thanks,

Xink

Link to comment
Share on other sites

Function that does Nothing, No to that also. AutoIt does not have that option. AFAIK, no one has created a capable DllCall, UDF or other means to set a Global variable to Nothing.

@SmOke_N

Assign it to "" again seems to bring var back to life. Dimming it will not. Guess the var may exist perhaps but really does contain Nothing. VBScript has no IsDeclared() equivalent to test if the var exists if it is set to Nothing.

Option Explicit
Dim var

'; Assign ""
var = ""

'; Set to Nothing
Set var = Nothing

'; Reintroduce var
var = ""
'Dim var

msgbox var
Edited by MHz
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...