Page 1 of 1

amount of characters question

Posted: Wed Oct 30, 2019 11:16 pm
by Pistris
Hi Guys

How do I get the amount of characters in a field (including spaces)

Thanks in advance

Edd

Re: amount of characters question

Posted: Wed Oct 30, 2019 11:41 pm
by [-hh]
put length(field "Name") into tL
[and please read the entry to length in the dictionary for more info]

Re: amount of characters question

Posted: Wed Oct 30, 2019 11:48 pm
by Pistris
Thank you -hh
I missed it, I was looking under properties of a field
the dictionary is not that easy to use

Edd

Re: amount of characters question

Posted: Thu Oct 31, 2019 12:16 am
by [-hh]
Edd,
you are right. What I meant with "read that in the dict" was to see the equivalent:
the number of chars in field "Name"
and all the synonyms (the length of, len(), the num of chars in etc.).

In LC Script any "amount of" question has mostly a "number of" answer ;-)

Re: amount of characters question

Posted: Thu Oct 31, 2019 12:39 am
by Pistris
Thanks man :)

Re: amount of characters question

Posted: Thu Oct 31, 2019 3:10 am
by dunbarx
hi.

Know that the "number" of things, like Hermann mentioned, is one of the fundamental gadgets in LC. You can ask for the number of words, buttons, cards, almost any "noun" in the language. The context changes, of course, if you are trying to find out the number of buttons on a card, as opposed to the number of words, say, in a variable or field, or characters, as you did.

The point is that if you wanted to know the number of characters in a field, that is not a property of that field. It is a function. The distinction is sometimes hard to distinguish.

Just don't try to ask for the number of numbers in "12345". :wink:

Craig