DataGrid Error: Trying to Load a Grid on Program Start

Andrew Kluthe andrew at rjdfarm.com
Thu Aug 26 15:10:57 EDT 2010


Hey all,

I have two datagrids that save the data within them to the disk when it is
changed and reloads from the file on program start. 

The files they save are tab delimited lines with the headers in line one.
This the output of the grid's dgText. On load, if the files are empty except
for headers it sets the dgData to of this grid to empty. 

The calls to load the files from disk appears in the Stack Script and the
grids themselves are on a card called "LocalData".

I get the following errors whether I set the data to empty or set it to the
data that is on the disk.

Type: Object: can't set object property
Object: group "AddTickets" of card "LocalData" of stack
"C:/FarmOffice/GrainCart/GrainCart.rev"
Line: set the dgData of me to empty
Line Num: 0
Hint: -8


AND

354,0,0,-8
90,4128,20
449,4128,5,-8
535,4128,1,-8
241,4128,1,_table.CreateDefaultHeaderGroup
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
"C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,4049,1
253,4048,1
253,4047,1
490,4045,1
241,4045,1,_table.CreateHeaders
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
"C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,3951,1
241,3951,1,_table.CreateColumns
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
"C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,151,1
253,150,1
253,113,1
241,113,1,_Initialize
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
"C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,4512,18
253,4512,1
241,4512,1,dgData
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
"C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
90,3205,36
449,3205,5
535,3205,1
241,3205,1,_table.SetText
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
"C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,4442,1
587,4440,1


I have tried two different methods for clearing the data to see if it was
how I was doing it that was causing the errors instead of what I was doing:

1. I tried using 

set the dgData of group "AddTickets" of card "LocalData" to empty

This failed.

2. I tried putting a command inside of the datagrid that has this code in
it.

on ClearData
set the dgData of me to empty
end ClearData

The code I used to call the handler inside the grid was:
send "ClearData" to group "AddTickets" of card "LocalData"

I even tried sending the above command in 3 seconds to see if it was that I
had not properly initialized something when it was executed.


The bizarre thing is that I have a third datagrid that holds the last Live
records in the database and setting it up in all of the above ways mentioned
works perfectly. 

Whats the deal?? I have been pulling my hair out.

-- 
View this message in context: http://runtime-revolution.278305.n4.nabble.com/DataGrid-Error-Trying-to-Load-a-Grid-on-Program-Start-tp2340227p2340227.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list