getProp syntax query

Graham Samuel livfoss at mac.com
Mon Apr 2 06:13:36 EDT 2012


For the very first time in a pretty long career as a LiveCode coder, I'm trying to make sense of DataGrids, which I see were a heroic effort to extend LiveCode - with a very sophisticated implementation and literally hundreds of pages of documentation. AFAIK it was done by Trevor deVore - I am deeply impressed, even as I stumble.

I am trying to implement some spreadsheet-like behaviour and have fallen more or less at the first fence during the lesson on Page 94 "How do I get Aggregate Values for Columns?".

I can make the example work if I follow it exactly. It depends on a getProp handler the first line of which is:

 getprop uSumOfColumn [pColumn]

I would like to multiply two columns using this as a starting point, so I would like to refer to two columns in my getProp handler. However when I look up getProp in the LC documentation, I don't see that getProp can take any parameters at all, certainly not an array reference, so my attempt to extend this structure with a line like

getProp usMultipleOfColumns [pColumn1] [ pColumn2]

can't be compiled - putting a comma in between the parameters (if that's what they are) doesn't help. As you see I have no idea what I'm doing. My question is, how does the syntax of the original getProp handler work? How is the bit in square brackets allowed, and why isn't it featured in the LC documentation? If I did want to provide a getProp handler with the names of two different columns, how would I do it? I do realise there are much more pedestrian ways of achieving what I want, but it seems important to understand the mechanism shown in the DataGrid docs.

Ignorantly

Graham




More information about the use-livecode mailing list