Datagrid stopper out of the gate

zryip theSlug zryip.theslug at gmail.com
Mon Jul 19 06:09:17 EDT 2010


On Mon, Jul 19, 2010 at 11:23 AM, Jim Ault <jimaultwins at yahoo.com> wrote:
> I am doing a quick study of the Datagrid object and getting a confusing
> result.
> For me, there is a time-deadline this week, so I need to figure this out
> quickly.
>
> Defining a datagrid group, five columns, then running the following stack
> script
> --   Rev 3.5.0   build 860
> --   relaunch and open only the test stack
>
> on testLoadDgrd   --postTimeDgrd
>   get the cpGTasklist of this stack
>     --using tab delimited lines
>   get line 1 to 11 of IT
>   set the clipboarddata to line 2 to -1 of IT
>   put true into keyy
>   set the dgText[keyy] of  group "postTimeDgrd" to IT
> end testLoadDgrd
>

set the clipboarddata to line 2 to -1 of IT
put true into keyy
set the dgText[keyy] of  group "postTimeDgrd" to IT

Assuming that the first line of IT contains your headers, the error
should be here.
By using the dgText[true] property, you specify to the data grid
library that the first line of the data, contains the column header.
In this case the DG engine try to make corresponding the data with the
column names of the data grid.
However here the first line passed to the DG is:
09:34     1     FLX     Farmington     NY

One of those solutions should resolve the problem:

set the clipboarddata to line 2 to -1 of IT
put false into keyy
set the dgText[keyy] of  group "postTimeDgrd" to IT

For using this second solution, the columns of your DG must be named with
Post      Race      Track      City      State
respectively

set the clipboarddata to line 1 to -1 of IT
put true into keyy
set the dgText[keyy] of  group "postTimeDgrd" to IT


-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc



More information about the use-livecode mailing list