Page 2 of 2

Re: Control names should not be using numbers?

Posted: Fri Jun 24, 2016 4:42 pm
by jacque
The LC 8 dictionary is in flux, still being converted to a new format. It's being actively worked on but the port was difficult and the fixes have to be done manually. So for now some of us use the LC7 dictionary temporarily.

If you haven't yet read through the user guide, I'd take a look. The overall concepts are described there.

Re: Control names should not be using numbers?

Posted: Fri Jun 24, 2016 5:45 pm
by FourthWorld
Ed_Ray wrote:Anyway knowing this now I won't just blindly follow the "infallible" syntax like I typically can in other languages but will be more careful in interpreting the INTENT of the syntax when the syntax is suspect.
If you find any documentation that describes the syntax as "infallible" that would be a bug itself, one I'd like to see fixed.

As you say, every language has its strengths and weaknesses. LC is more forgiving of white space than Python, and less cumbersome than double-dereferencing structure handles in C++ and then have to explicitly coerce types. But like any language, LiveCode isn't a magic pony, and it does have a few rules.

Once you learn that this syntax is used for referencing objects by either name or ordinal number:

Code: Select all

get the long id of button <something>
...hopefully it becomes clear that <something> can be a string or an integer, and when it's an integer an ordinal lookup is attempted.

That's pretty much it.

If it's necessary to include an integer in an object's name, you can prepend it with any string to ensure the name will be treated as a string during reference evaluation, e.g.:

Code: Select all

get the long id of button "b12"
Imperfect indeed, and definitely not infallible. But on the whole not bad.

Re: Control names should not be using numbers?

Posted: Fri Jun 24, 2016 7:36 pm
by richmond62
If you find any documentation that describes the syntax as "infallible" that would be a bug itself
LC is more forgiving
of almost anything.

Livecode, inevitably, has its short-comings.

But its strengths are what we should be celebrating, as they far out-weigh those short-comings:

1. It is flexible; there are many, many ways to "skin a cat".

2. It has an in-built IDE that does a reasonable job at catching mistakes.

3. None of the code . . . compile . . . run nonsense.

4. WYSWYG.

Yesterday I watched a pupil of mine doing some homework for the Maths High School in C++:
he was doing this on his laptop in a common-or-garden texteditor which, obviously, didn't
"know" right from wrong.

He hates me . . .because I have introduced him to Livecode, but he still has to do

"All That Crap" {His words not mine; Hey, at least I've taught him how to express himself in English!]

in a texteditor for his fossilised teacher at the Maths school, who is fossilised, largely, owing to
a fossilised Education Ministry and so on . . .

Frankly, I'm glad he "hates me" (he said it with a smile on his face) if he realises the value of Livecode.