How to find the column and row of a basic tableField
Curry Kenworthy
curry at pair.com
Thu Apr 2 14:13:35 EDT 2020
We don't need to confuse people - it DOES cause damage, because readers
often trust confident/prolific statements without realizing which ones
are flawed, and they act upon bad information. It often falls to
consultants and trainers like myself to help individuals fix the
resulting problems later. I guess that's good for business, but as an
ethical person I also like to prevent headaches for others before they
happen. I can't in good conscience let incorrect info slip by unchallenged.
Despite a lot of good info posted, there has been also considerable
intentional "spin" on this topic in various threads, as well as several
outright inaccurate claims, all of which could easily be confusing, so
here's an ACCURATE FACTS RECAP (for all related threads) that people who
desire real info can easily verify as factually correct and trust as
reliable and objective:
1. Can fields display inline images? YES! A large number of images can
be displayed.
2. Can fields display checkboxes? Only CUSTOM designed ones, which can
work well.
3. Can we figure out which field column was clicked? YES!
4. Have we had this ability (#3) for a long time? YES! Since LC/RR 1.0
at least.
5. Is finding which column something people commonly know or can figure
out? Not sure, but SEVERAL people immediately provided sample code.
(This was attempted as a strawman claim, it was not my claim, but
hilariously backfired.) Actually there are at least THREE different
approaches, two of which are generally applicable and the other also
valid and interesting but specialized to certain content requirements.
I'm not counting additional handy approach(es) that rely on an existing
implementation of one of these three.
6. Does finding which column via tabstops require a "convoluted"
solution with lots of code? HECK NO; that's rubbish! It has been
available as a one-line function call without rolling your own since at
least 2012 with SpreadLib. Also available with other libraries. And
while rough sample functions have been posted here, some of us
specialize in more efficient techniques and have much sleeker code.
7. Does finding which column require using the simple table field
setting with cell edit enabled? NO! Not at all. The wording of the
subject line might confuse people, but this was later clarified by Bernd
regarding his helpful code sample.
8. Is using a datagrid somehow more trouble than setting up a field for
desired table features? Depends on the approach, but IRRELEVANT to the
original issue of WHETHER finding which column was available on regular
fields. (In context of recent discussions, this was another strawman
argument introduced to reframe the discussion and walk back previous
incorrect claims.)
The reality is that multiple solutions are available to choose from,
there are precoded solutions and sample code available, and each
approach has some pros and cons. Do NOT be confused by "fans" of an
approach (usually DG) who exaggerate and cherry-pick (or just make
confident assertions) to sway others. They may sound confident, but the
actual facts don't change based on who has the time and energy to be
more talkative. Datagrids are fairly easy to set up, but the flip side
is that they also more complex and subject to the limitations and
consequences of that complexity. Those familiar with KISS and
optimization will understand such considerations; well-documented in
Computer Science. Fields have their pros and cons too. Be aware that you
have choices, and which solution is superior depends on your project
requirements.
Finally, while having a pre-coded solution is nice (and we've had some
for years) people shouldn't be misled into thinking this is an extremely
difficult problem. The math algorithm is simple to understand. Not
rocket science by any stretch of the imagination; in fact, this is much
closer to real-world problems encountered thousands of years ago in the
Bronze Age or perhaps even earlier in the Neolithic. Literally somewhere
between Jericho and Sumer in the level of progress and difficulty. The
math is not complicated - it makes a good student learning exercise. If
people think this is really hard, society may be in trouble! :)
This and other topics with some inaccurate claims have inspired me. When
I get caught up, along with other things eventually I'll launch a Facts
vs Myths/Fake News web page to help newbies sort out reliable
information about LiveCode features. Accuracy is important and must not
be lost among all the "politics" and opinions of discussions. Take care,
all! Be safe about quality code, accurate info, and virus
precautions/social distancing.
Best wishes,
Curry Kenworthy
Custom Software Development
"Better Methods, Better Results"
LiveCode Training and Consulting
http://livecodeconsulting.com/
More information about the use-livecode
mailing list