hiding 1st column of table field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: hiding 1st column of table field

Post by marksmithhfx » Wed Nov 23, 2022 5:16 pm

dunbarx wrote:
Tue Nov 22, 2022 11:33 pm
Bernd.

Getting there.

Mark.

Can you live with centered text? With this handful of settings, you would not have to pluck out the data in column 1. I personally would prefer anything rather than having to manage that.

Craig
Thanks everyone for bringing your wisdom and experience to the problem. At this point I think the next step is to take it to the mothership to see if they have any suggestions, and if not, I'll make a feature request to have column width = 0 function in the first column as it does in other columns.

Craig, the workaround is not *that* bad :lol: . Especially given LC text handling ability and speed. I'm only expecting to have to process tables in the hundreds of rows, not thousands, so I doubt it will add more than a 0.x increase in processing time. And it is only 4 or 5 lines of code. I can live with it.

BTW, there was another use for the 1st column which I had forgotten about. After you combine the array by return and tab the results are in some sort of funky random order and not 1..N (array keys). So I have to sort the resulting list by the 1st col in order to get them back into array order. After that I could dispense with them, but I keep them around for the "reset" option.

Anyway, thank you for your valiant attempts. I'll let you know what tech support has to say.

Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: hiding 1st column of table field

Post by dunbarx » Wed Nov 23, 2022 9:29 pm

Make.

If it works, it works.
After you combine the array by return and tab ...
This is just the way LC arrays work. They are purely associative and could care less about anyone's idea of order. We all do that sort of thing right after the "combine" command.

Craig

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: hiding 1st column of table field

Post by marksmithhfx » Wed Nov 23, 2022 10:44 pm

dunbarx wrote:
Wed Nov 23, 2022 9:29 pm
We all do that sort of thing right after the "combine" command.

Craig
Fun, isn't it. Still haven't fully wrapped my head around associative arrays. :?
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: hiding 1st column of table field

Post by dunbarx » Thu Nov 24, 2022 12:26 am

Fun, eh? Probably.

It just means there is no native way to sort an array. It has to be brought "back" into LC, that is into a container of some sort, a field or a standard (not array) variable, say, in order to be processed. One gets used to it.

I use arrays when creating some sort of dataSet where building an array is much more compact than building any other type of container. The simplest example I can think of is as a counter for multiple changing values:

Code: Select all

add 1 to myCounter[variable]
where "variable" can change, usually in a repeat loop. It is much simpler this way than in any other.

Anyway, I cannot think of an occasion where I had an array, processed it back in LC and then made an array again. Once it is "out" everything else I ever needed to do with it required "regular" LC.

Craig

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: hiding 1st column of table field

Post by bn » Thu Nov 24, 2022 1:04 am

dunbarx wrote:
Wed Nov 23, 2022 9:29 pm
After you combine the array by return and tab ...
This is just the way LC arrays work. They are purely associative and could care less about anyone's idea of order. We all do that sort of thing right after the "combine" command.
Craig
There is one instance that I know of where you can preserve the original order of data after converting it to an array by "split" and then combine it where the order is preserved: combine by column.

The use case: get the lines of a field, split them into an array, do your text manipulation in the array and then combine the array by column. The order is the same as the original order of the lines in the field.

getOrderedArrayColumn.livecode.zip
use to test claims
(1.71 KiB) Downloaded 71 times


Click on button "fillsource" to get text, then click button "getArray->combineByColumn" to convert the text of field source to an array and then combine the array by column. (set breakpoints in that button to see what is going on) The result is put into the right hand field with a right most field displaying the keys of the array.

The other instance to get ordered data from an array is when the array is numerically indexed and the numbers are contiguous then you can use

Code: Select all

   repeat for each element anElement in tData
      put anElement & cr after tCollect
   end repeat
   delete char -1 of tCollect
That code is in button "getArray->eachElement" see script. It is a tad faster then using the keys of the array. (according to Mark Waddingham)

But of course the safest way is to use the keys, sort them and extract data from the array unless you know what you are doing.

Kind regards
Bernd

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: hiding 1st column of table field

Post by dunbarx » Thu Nov 24, 2022 5:23 am

Interesting stuff, Bernd.

Craig

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: hiding 1st column of table field

Post by marksmithhfx » Thu Nov 24, 2022 12:46 pm

dunbarx wrote:
Thu Nov 24, 2022 12:26 am
Fun, eh? Probably.

It just means there is no native way to sort an array. It has to be brought "back" into LC, that is into a container of some sort, a field or a standard (not array) variable, say, in order to be processed. One gets used to it.
Thanks for the gentle "Canadian" reminder Craig. I must be losing my touch... yes, fun eh? :D

I have always thought of associative arrays as meaning the value of the array element is associated with a key, which by definition could be defined as anything. Hence, no intrinsic order. But didn't I read somewhere that LC was planning to make adjustments or enhancements to the array structure to make it more compatible with JSON?

Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: hiding 1st column of table field

Post by marksmithhfx » Thu Nov 24, 2022 12:49 pm

Great examples Bernd, and working through them does help with my understanding of combine and split. It would be great if we had a wiki we could throw these types of well-worked examples into for easy retrieval in the future. Hint, hint Steven Creighton :D
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9840
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: hiding 1st column of table field

Post by FourthWorld » Thu Nov 24, 2022 5:51 pm

marksmithhfx wrote:
Thu Nov 24, 2022 12:49 pm
It would be great if we had a wiki we could throw these types of well-worked examples into for easy retrieval in the future. Hint, hint Steven Creighton :D
These forums serve that role right now.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: hiding 1st column of table field

Post by marksmithhfx » Fri Nov 25, 2022 4:46 pm

FourthWorld wrote:
Thu Nov 24, 2022 5:51 pm
These forums serve that role right now.
Hi Richard,

I was thinking of something that was a tad more formal: vetted, curated and updated. There is lots of out-of-date information in the forums, not all of it has been vetted for relevance or accuracy and by its nature, none of it gets updated. So I was thinking of something that might have as a starting point the dictionary we now have in LC, but with additional examples that are vetted for relevance and accuracy, are kept updated if things change and are organised such that they are part of the overall topic under discussion and not scattered here and there... it also could provide pointers to relevant tutorials on the topic, be they on the LC site or somewhere else (since there are several sites throughout the internet, such as BYU, that offer excellent tutorials on various subjects). Aside from errors in the LC dictionary (and there are many) I think it never links to tutorials, or excellently worked examples, like the one Bernd just provided. Perhaps not all of this information needs to be physically combined in one place, but at least providing links from a core dictionary to other sources of example or instruction on the topic would, I think, be beneficial. As an added benefit, some of the errors in the dictionary might get fixed as well :D

Don't get me wrong, the forums are valuable and I use google to search them all the time for relevant information. But it is a bit hit and miss whether my google queries will find the gems I am looking for, if the information is still relevant, and if it ever worked in the first place.

BTW, I understand this might require an army (even just a small one) of volunteers but like the moderators on the forum, I am certain we could find some folks who would be interested in improving on or expanding on the documentation we have available (and as you might gather from my answer, this is a topic very near and dear to me heart :) ).

Cheers,
M
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: hiding 1st column of table field

Post by marksmithhfx » Fri Nov 25, 2022 6:11 pm

marksmithhfx wrote:
Wed Nov 23, 2022 5:16 pm

Anyway, thank you for your valiant attempts. I'll let you know what tech support has to say.
So I said I would follow up on this topic. Tech support agreed it should work like it does for all the other columns and asked me to file a bug report. Done!

https://quality.livecode.com/show_bug.cgi?id=24031

Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9840
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: hiding 1st column of table field

Post by FourthWorld » Fri Nov 25, 2022 7:05 pm

marksmithhfx wrote:
Fri Nov 25, 2022 4:46 pm
FourthWorld wrote:
Thu Nov 24, 2022 5:51 pm
These forums serve that role right now.
Hi Richard,

I was thinking of something that was a tad more formal: vetted, curated and updated. There is lots of out-of-date information in the forums, not all of it has been vetted for relevance or accuracy and by its nature, none of it gets updated.
I omitted the word "perfectly" on purpose. ;)

You're right, as long as these forums are used as more of a general social media than a support resource, the content here will lack the focus and self-discipline that would characterize wiki content.

But it's worth noting Stack Overflow as a resource widely acknowledged as immensely valuable for focused high-quality content, with little if any expense needed from the core teams of any tool or language discussed there.

There's moderation on SO, but relatively little compared to the overall quality of content. The expectation for content contributors is well established: stay on topic, avoid conjecture in favor of known solutions, leave space for the OP to provide clarification where needed before guessing and branching the conversation in multiple directions; in short, add value.

In a thread about hiding the first column in a field, apparently I'm doing no better than anyone else by indulging in this conversation about content management practices here ;) (though I may move it to its own thread if it becomes much more of a thing here).

In any business, doing one thing means not doing something else. Awareness of the opportunity cost of any undertaking empowers an organization (or individual, really) to make solid choices that maximize the revenue potential needed to keep the lights on and hopefully even thrive.

It's easy (and not at all unjustified in many cases) to come up with lists of things for others to do. It's much harder to actually do them.

Consider the billable hourly rate of LC personnel, and multiply by the number of hours needed for the content curation process you described for making sure a wiki is well organized, accurate, and complete, both for initial setup and ongoing in editing/refining.

Then pick something from the team's existing work queue that we want them to suspend work on in order to free up the resources for a wiki process.

Add the cost of the wiki process to the lost value of what that work displaces, and you have a figure representing total organizational impact.

A good idea, but not free.

So for the moment, warts and all, these forums are the de facto existing alternative to adding a wiki.

And one benefit of consciously using these forums as a value-adding focused learning resource is that we the contributors already have complete control over the quality of the content to be found here.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: hiding 1st column of table field

Post by dunbarx » Fri Nov 25, 2022 7:07 pm

Richard.

Did you really mean:
leave space for the OP to provide calcification where...
Because if so, I applaud you mightily. :D

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9840
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: hiding 1st column of table field

Post by FourthWorld » Fri Nov 25, 2022 7:57 pm

dunbarx wrote:
Fri Nov 25, 2022 7:07 pm
Did you really mean:
leave space for the OP to provide calcification where...
Because if so, I applaud you mightily. :D
I've broken just enough bones in my day to appreciate calcium, but calcification generally refers to an overabundance of bone matter best avoided as it can reduce mobility.

In short, no. ;)

Tho it does raise a question of how implementers of auto-correct came to believe that "calcification" occurs in colloquial English more commonly than "clarification".

Corrected, and thank you for drawing my attention to that. I trust Swype far more often than merited.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mrcoollion
Posts: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: hiding 1st column of table field

Post by mrcoollion » Mon Nov 28, 2022 5:36 pm

Using a data grid makes it possible to hide a column.

Regards,

Paul

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”