Piorun Posted June 18, 2011 Posted June 18, 2011 Hi I want today to get a number of letters in word. For ex. I've got word "gta", and i want to create a function which i can output into chat box the number of letters in this word - 3. How to do it?
gokalpfirat Posted June 18, 2011 Posted June 18, 2011 gta = "gta" outputChatBox ( #gta, getRootElement(), 0, 255, 0, true ) I dont test it but it can work.
JR10 Posted June 18, 2011 Posted June 18, 2011 gta = "gta" outputChatBox ( #gta, getRootElement(), 0, 255, 0, true ) I dont test it but it can work. Hmm, i am not sure but i think that won't work here: string.len('gta') Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
gokalpfirat Posted June 18, 2011 Posted June 18, 2011 text = "gta" outputChatBox ( #text, getRootElement(), 0, 255, 0 ) I test it and works:)
Aibo Posted June 18, 2011 Posted June 18, 2011 gta = "gta" outputChatBox ( #gta, getRootElement(), 0, 255, 0, true ) I dont test it but it can work. Hmm, i am not sure but i think that won't work # returns table length if used with a table (numeric indexed) and string length if used with a string ?
JR10 Posted June 18, 2011 Posted June 18, 2011 He said it works i thought it won't because it's for tables so anyway it should be string.len. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Antibird Posted June 19, 2011 Posted June 19, 2011 because it's for tables Both strings and tables lua.org
JR10 Posted June 19, 2011 Posted June 19, 2011 No problem. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now