Sign in to follow this  
Followers 0
Xink

vbs keyword (nothing)

7 posts in this topic

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

Share this post


Link to post
Share on other sites



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: )


[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

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

Share this post


Link to post
Share on other sites

@MHz ... Thanks :lmao:


[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

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I'm not sure what you are trying to accomplish.

If you are trying to destroy an instance of an object, then the code to change that has changed recently.

Post some code/examples...

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