LEN command
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
LEN command
I'm struggling to work out how to use the LEN command to work out the amount of characters a word that the user enters has. Could anyone give me an example on how to do it please?
-
- Posts: 29
- Joined: Sat Apr 10, 2021 6:56 pm
Re: LEN command
isn't 'len' a Python method? I believe LiveCode uses 'length'
Example: the length of "ABC" -- returns 3
Example: the length of "ABC" -- returns 3
-
- Posts: 29
- Joined: Sat Apr 10, 2021 6:56 pm
Re: LEN command
More info here:
https://livecode.fandom.com/de/wiki/Length
https://livecode.fandom.com/de/wiki/Length
Gary E Chike DMD
"Experience is what you get when you don't get what you want"
"Experience is what you get when you don't get what you want"
-
- Posts: 29
- Joined: Sat Apr 10, 2021 6:56 pm
Re: LEN command
I'm not sure if this is what you're trying to do or if there is a better way. I'm learning LC myself.
I wrote this bit of code and it works
I wrote this bit of code and it works
Code: Select all
on mouseUp pButtonNumber
ask "Enter some text"
put it into aWord
answer "Your text has " & length(aWord) & " letters in it."
end mouseUp
Gary E Chike DMD
"Experience is what you get when you don't get what you want"
"Experience is what you get when you don't get what you want"
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: LEN command
Hello, NoSwaze. What are you building with LiveCode?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9580
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: LEN command
Going back to the beginning, "len" is a synonym for "length". I don't particularly like it, and never use it.
Craig
Craig
-
- Posts: 29
- Joined: Sat Apr 10, 2021 6:56 pm
Re: LEN command
So, 'len' is a synonym of 'length' afterall. Good to know
Gary E Chike DMD
"Experience is what you get when you don't get what you want"
"Experience is what you get when you don't get what you want"