Jump to content
UBot Underground

If Variable Empty Then Do


Recommended Posts

OMG, m i brainstopped or it is imposible to code this?

 

So i have variable which is empty. I tryed this:

 

    if($contains(#tcode,$nothing)) {
        then {
        }
        else {
            change attribute(<name="trackingCode">,"value",#tcode)
        }

 

And i dont know how else can i do this. Any tips?

Link to post
Share on other sites

use "comparison" ;)

if($comparison(#tcode, "=", $nothing)) {
    then {
    }
    else {
        change attribute(<name="trackingCode">, "value", #tcode)
    }
}
Edited by zenos
  • Like 2
Link to post
Share on other sites

Here is a function for that.

 

alert($IS Empty(""))define $IS Empty(#FIRST VALUE) {

    return($comparison(#FIRST VALUE"="$nothing))

}

In all my years coding in Ubot, I never thought of doing things like this. Good one mate!

  • Like 1
Link to post
Share on other sites

Here is a function for that.

 

alert($IS Empty(""))

define $IS Empty(#FIRST VALUE) {

    return($comparison(#FIRST VALUE"="$nothing))

}

 

Haha its Funny i always use almost the same exact Thing in my Bots!

 

its a small world!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...