Jump to content

[SOLVED] Check string's length


Rudy

Recommended Posts

Hey guys,

What's the problem with this?

if string.len(guiGetText(varible)) == 0 then 
    --something 
end 

I think nothing, but it isn't works. I tested the guiGetText function with this varible, and it's works. Zero errors printed to my server's log.

Thanks,

Rudy

Edited by Guest
Link to comment
I tested the guiGetText function with this varible, and it's works. Zero errors.

It isn't that important, because this is only a comfort function - but it'd be good if somebody write down what is the problem. Lines before and after this code are work too.

Link to comment
Yes, If it's empty returns false. I tested it first. And I write down again: errors do NOT exist. But I reinstalled all MTA server files, and the problem's solved.

If the string is empty it should return 0 as far as I'm aware, and not false. It would only return false if the GUI element does not exist or it received something other than a string.

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...