Datagrid stopper out of the gate

Jim Ault jimaultwins at yahoo.com
Mon Jul 19 07:37:05 EDT 2010


When I use
>
>
> put false into keyy
> set the dgText[keyy] of  group "postTimeDgrd" to IT
the header labels in line 1 become the first row of data
and the rest of the data fills in all of the columns.

and by making one change... false to true
>
> put true into keyy
> set the dgText[keyy] of  group "postTimeDgrd" to IT
the grid only has data in the first column
as if the only column header that matched was the first one.

So let's say I did not use the correct spelling for column 2 "Race"
wouldn't the default be for new columns to be created to accommodate?


Jim Ault
Las Vegas



On Jul 19, 2010, at 3:09 AM, zryip theSlug wrote:

> 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
>
>







More information about the Use-livecode mailing list