The problem is that when 'set the dgText' runs it's like occasionally stops the script. We're calling the command below from the Stack script. On openStack we're opening/creating a database and then calling the command userGridUpdate, then we go to the Home card to view the grid of users. The database is bring created successfully and there is a record in the table. The grid has two columns where the userID is hidden and the username is visible.
If I manually go to the Home card, the Message Box appears with this:
Code: Select all
89,8775,50,dgAlternatingRows
77,8775,50
456,8775,38
380,8775,9
572,8775,1
253,8759,1
241,8759,1,_DrawAlternatingRows
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "/Applications/LiveCode 4.6.1.app/Contents/Tools/Toolset/revdatagridlibrary.rev"
573,87,1
253,86,1
Code: Select all
command userGridUpdate
## Create tab delimited data.
Note that first line has name of columns.
Providing names tells Data Grid how to map
data to appropriate columns.
if databaseID = -1 then exit to top
put revDataFromQuery( tab, return, databaseID, "SELECT IDuser, name from users") into userRecords
put "IDuser" & tab & "Name" & cr before userRecords
answer information "About to set the Grid: " & cr & userRecords
set the dgText [ true ] of group "userGrid" on Card "Home" to userRecords
// true is for 'first line has column names'
answer information "Grid is set."
end userGridUpdate
Hal Gumbert, CampSoftware