Debugging DataGrid script

George C Brackett gbrackett at luceatlux.com
Tue Jun 23 08:08:24 EDT 2009


This may not help (I can't remember if you had headers or not), but I  
got stuck with the same code, copied from the PDF docs). My datagrid  
stayed blank until I noticed the following, printed shortly after the  
code:

"Note that if pFirstLineContainsHeaders is true then the columns must  
already exist in your data grid
table in order to be displayed."

George

On Jun 22, 2009, at 10:27 PM, Trevor DeVore wrote:

On Jun 22, 2009, at 8:14 PM, mfstuart wrote:

> I originally got that script line from Trevor's web site.
> I tried it with the [] brackets, both with space and no space.
> I tried it without the [] bracket value.
> All 3 ways the script stops running at this line, with no returned  
> error.

Your syntax is fine. Spaces around brackets won't affect the parsing  
and since firstLineContainsHeaders is a variable it shouldn't have  
quotes around it.

> Trevor, anyway to find out what's going on setting a DataGrid NOT  
> from the
> place where the DG object is and this error?

A data grid table won't work so well if you try to work with it on  
cards that aren't open. The data grid table tries to access the  
formattedHeight property of fields  when working with the header. This  
property always always return 0 if the card isn't open.

In addition if you dig around in the code you would find that some  
control references are stored with the card/stack references stripped.  
This is probably causing the immediate error. It is easy enough to  
update the data grid to resolve the cached control references but I'm  
not sure about addressing the formattedHeight issue. I will have to  
investigate.

Regards,

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list