Column
Moderator: Klaus
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Column
It would be great if one could refer to the columns in tableFields with the word 'column',
as, for instance in:
put "XYZ" into column 3 of line 4 of fld "fTableF1"
as, for instance in:
put "XYZ" into column 3 of line 4 of fld "fTableF1"
-
- VIP Livecode Opensource Backer
- Posts: 153
- Joined: Wed Aug 26, 2009 7:42 pm
- Contact:
Re: Column
See http://quality.livecode.com/show_bug.cgi?id=4623
Obviously, if you look at the bug number, this has been a feature request for a long time.
Obviously, if you look at the bug number, this has been a feature request for a long time.
Paul Dupuis
Researchware, Inc.
Researchware, Inc.
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Column
2007: must be very nearly a record.
I wonder why nothing has been done about this when it seems rather an
obvious feature request?
I have added a comment to that Bug report in a desperate attempt to get it noticed by the mothership at last.
I wonder why nothing has been done about this when it seems rather an
obvious feature request?
I have added a comment to that Bug report in a desperate attempt to get it noticed by the mothership at last.
-
- VIP Livecode Opensource Backer
- Posts: 153
- Joined: Wed Aug 26, 2009 7:42 pm
- Contact:
Re: Column
I think one reason it has not been implemented is that it is pretty easy to write your own function to return a numerically indexed column from a tab and return delimited table.
function columnFromTable pTable, pColumnIndex
local tData
set itemDel to tab
repeat for each line tLine of pTable
put item pColumnIndex of tLine & cr after tData
end repeat
if last char of tData is cr then delete last char of tData
return tData
end columnFromTable
It is just not as elegant using:
put columnFromTable(myTable,3) into my3rdColumn
as saying
put column 3 of myTable into my3rdColumn
function columnFromTable pTable, pColumnIndex
local tData
set itemDel to tab
repeat for each line tLine of pTable
put item pColumnIndex of tLine & cr after tData
end repeat
if last char of tData is cr then delete last char of tData
return tData
end columnFromTable
It is just not as elegant using:
put columnFromTable(myTable,3) into my3rdColumn
as saying
put column 3 of myTable into my3rdColumn
Paul Dupuis
Researchware, Inc.
Researchware, Inc.
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Column
Um: well if that were the case Livecode might not have half the functions it has.it is pretty easy to write your own function
-
- VIP Livecode Opensource Backer
- Posts: 153
- Joined: Wed Aug 26, 2009 7:42 pm
- Contact:
Re: Column
Not arguing that. Just offering a possible explanation. LC doesn't have the resources to do everything people would like them to, so if I was in their position, choosing between features that can only be implemented in the engine or via externals or widgets vs things that are scriptable, I would weight what I worked on more towards the former.richmond62 wrote:Um: well if that were the case Livecode might not have half the functions it has.it is pretty easy to write your own function
Personally, I'd love to see a 'column' chunk type that can be used both with delimited data and with arrays. I think for many people, myself included, it would be a highly welcome addition to the language given how much tabular data I work with. That is why I posted the bugzilla link and responded.
Paul Dupuis
Researchware, Inc.
Researchware, Inc.
Re: Column
"Column" is already in use with arrays. Since it's a reserved term, it may not be appropriate for another context.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 153
- Joined: Wed Aug 26, 2009 7:42 pm
- Contact:
Re: Column
You are referring to the split and combine commands?jacque wrote:"Column" is already in use with arrays. Since it's a reserved term, it may not be appropriate for another context.
The proposal in the bug entry also request using 'column' in the following form
get column 3 of tArray -- return an array of the 3 ordinal key of the second array dimension for each primary key for which a value exists.
Paul Dupuis
Researchware, Inc.
Researchware, Inc.