Hi Richmond,

Ten is defined as a constant and tenth as a keyword according to the dictionary. Eleven and eleventh aren't defined. Although a warning might be appropriate, it is easy to find out why it doesn't work, if one reads the dictionary: eleven and eleventh don't exist. Unfortunately, something lacking from the dictionary doesn't always mean that it doesn't exist :-(

I agree it is silly that LiveCode only contains the constants one to ten. I'm not sure that it is possible to have an infinite number of constants defined as ordinal numbers, but it should be possible to do this for very large numbers. Perhaps a feature request?

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Installer Maker for LiveCode:
http://qery.us/468

Buy my new book "Programming LiveCode for the Real Beginner" http://qery.us/3fi

LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 7/3/2014 21:44, Richmond wrote:
So I have a field containing a text string (nothing very special there).

BUT, I want to delete the eleventh character.

Now scripts like this:

delete the tenth char in fld "TEKST"

work superbly.

But after 'tenth' we get "in a pickle" . . . .

and we have to do this:

delete char 11 in fld "TEKST"

SO; after 'tenth' we switch from Ordinal to Cardinal numbering, which is:

1. Inconsistent.

2. Makes the "Livecode Programming is in easy to understand English"
sort of pronouncement
look a bit disingenuous.

3. The Dictionary does NOT warn users about this change:

for instance, if one types 'tenth' into the Dictionary search one gets
this:

"Use the tenth keyword in an object reference or chunk expression.

It does NOT contain a "Government Health Warning" like this:

For references above 10 one must use Cardinal numbers and the syntax of
statements is
different.

-----------------------------------

Today, having got my 10-13 years olds onto importing and exporting RTF
documents;
one of them [you know the one: the one you want to both throttle and
admire for
his/her thinking about 3 kilometres in front of you] asks "how do I set
up a series of buttons to delete
the first, second and third character in a textField?" SO, told her
(let's cut out the politically correct crap; all the kids I teach who
get their heads round Livecode really quickly are girls: the boys just
lose interest)
to use:

delete the third char . . .

Of course she obviously overdosed on Coca-Cola before class and decided
to have buttons for 1st to 20th (well, she may be good at programming,
but she is still a 12 year old kid); and, obviously things go
pear-shaped at 'eleventh'.

So told the girl that at that point you have to do:

delete char 11 . . .

AND; LO! out of the mouths of babes . . .

"That's silly!"

Which it is, frankly.

SO: I did the usually "middle-aged teacher fudges around so that,
eventually, he looks even more
stupid than he does already" and told her that the best way to get
around that was to do:

delete char 1 . . .

and, of course, her reply was: "So, if that's best why did you tell me
about 'first, second' and 'third'?"

Now I had a choice of things to say at that moment:

1. "Because I'm a slob who didn't think about that problem." [possibly
the only reasons I didn't use this
one was that it was a bit early in the morning for honesty, and, as a
Bulgarian learning English she
doesn't know the word 'slob']

2. "Because I didn't think you would go beyond 'third'"

Neither of which are frankly satisfactory.

-------------------

Love from the "chalk face", Richmond.

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to