Hi Hugh, Thank you again for the code.
When I first mentioned I tested your code I said that for some reason it was causing me problems and I would need to force quit the program, A few days before that I replied to Richmond’s post about spies under his bed. My home page was Google and now it is Yahoo. I was attacked by MacKeeper and I personally think it was done from Google and with their permission. I also suspect they share the same management & they are Booz, Allen, Hamilton. I have been in a war with them for over 20 years now and I continue to expose their criminal activity and abuse of power. The reason why I sometimes have trouble with what seem to be small things like not seeing the code did allow more than one column to be deleted is because I am being poisoned in my own home in such large amounts I can hardly see plus it causes problems with thinking and lowers the ability to learn, The recent attack from MacKeeper prevented me from accessing my bank account and when I would to to a web site their ad would appear instead. I believe the problem caused my computer memory to over load and that is why I would need to force quit the program. I have posted this to let you know since I did mention the problems happen when I used your code. John Balgenorth On Sep 6, 2014, at 2:44 AM, FlexibleLearning.com <ad...@flexiblelearning.com> wrote: > Peter: Thank you for adding column ranges. > Mike: Thank you for the column extraction handler. > > I believe this summarises our efforts to date. It includes column ranges and > the ability to either delete or extract columns of data from a table. I > accept that optimisation has been compromised in favour of code brevity when > extracting columns, but the time overhead is negligible. > > function manageColumns pData,pCols,pAction,pDelim > -- Purpose: To delete or extract specified columns from a table > -- Syntax: manageColumns <data>,<cols>,<action>[,<delim>] > -- data: Specifies the data to parse > -- cols: A comma separated list of columns or column ranges to be > removed or extracted > -- for example "2,5,7" > -- or a column range: "3-5" > -- or a combination "2,4-5,7,9-11," > -- action: Either "delete" or "extract" > -- delim: Optional column separator for example "," or "|" > -- if unspecified, defaults to TAB > -- By: Hugh Senior, based on handlers by Michael Doub, based on a handler > by Peter M. Brigham, based on a handler by Hugh Senior, Use-LC list > > if pCols ="" then return pData > if pDelim <>"" then set the columnDelimiter to pDelim > repeat for each item tCol in pCols > if "-" is in tCol then > set the itemDel to "-" > repeat with i = item 1 of tCol to item -1 of tCol > put i & comma after pColsExpanded > end repeat > set the itemDel to comma > else > put tCol & comma after pColsExpanded > end if > end repeat > put char 1 to -2 of pColsExpanded into pCols > split pData by column > put item 2 of extents(pData) into tMax > repeat with n=1 to tMax > if pAction="delete" then get (n is NOT among the items of pCols) > else get (n is among the items of pCols) > if it then > add 1 to x > put pData[n] into pData[x] > end if > end repeat > repeat with n=x+1 to tMax > delete local pData[n] > end repeat > combine pData by column > return pData > end manageColumns > > > > Hugh Senior > FLCo > > > > _______________________________________________ > 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