Jump to content
UBot Underground

$Comparison And $Is Number


Recommended Posts

Hi

 

Code:

ui text box("Test Value",#test)
ui button("Test 1") {
    if($is number(#test)) {
        then {
            alert("Yes its number")
        }
        else {
            alert("It should be number")
            stop script
        }
    }
}
ui button("test 2") {
    if($comparison($is number(#test),"= Equals",$false)) {
        then {
            alert("It should be number")
            stop script
        }
        else {
            alert("Yes its number")
        }
    }
}

This test to prove

$is number

return value is not same as

$comparison

return value

 

image:

http://i.imgur.com/ANRPIkp.png

i cant find doc on this, hope it helps others.

 

( btw, is it bug ? )

Edited by kate
Link to post
Share on other sites

no. it not bug.

 

run it.

alert("What are the differences
{$is number("x")}
{$false}")

If you want the same results.

ui text box("Test Value",#test)
ui button("Test 1") {
    if($is number(#test)) {
        then {
            alert("Yes its number")
        }
        else {
            alert("It should be number")
        }
    }
}
ui button("test 2") {
    if($comparison($change text casing($is number(#test),"Lower Case"),"= Equals",$false)) {
        then {
            alert("It should be number")
        }
        else {
            alert("Yes its number")
        }
    }
}
Link to post
Share on other sites
pash 

thank you for pointing me that. In future if somebody need documentation, they can find it here

 

maybe because "is number" is bot bank command so there's different way to say true/false

Link to post
Share on other sites
  • 3 weeks later...

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