How to add data using SCTable?

Having trouble using an XCmd or XFcn? Post your questions here.

How to add data using SCTable?

Postby MichaelBluejay » Mon Jun 21, 2010 7:53 pm

I opened the sample project and did createWindowGroup, createTable, addColumn, and addRecord. The first row of the table is now editable.

When I try to enter data with this command via the message box:
SCTable("setValueForColumnAtIndex","wd id 100","myTable","Firstname",0,"test")


SC just beeps and the second line of the message box says "false". No data appears in the table.

I also notice that SC crashes if I close the project window without hiding the table first.
MichaelBluejay
 
Posts: 28
Joined: Wed Jan 06, 2010 2:15 pm

Re: How to add data using SCTable?

Postby sctell » Wed Jun 23, 2010 9:36 am

MichaelBluejay wrote:SCTable("setValueForColumnAtIndex","wd id 100","myTable","Firstname",0,"test")


I think you have the column identifier incorrect.

In the sample the column identifier for the column titled Firstname is firstNameColumn

Here is part of the code that creates the columns:


Code: Select all
put "firstNameColumn" into tColumnIdentifier
put 200 into tMaxWidthOfColumn
put "Firstname" into tColumnTitle
put SCTable("addColumn","wd id 100","myTable",tColumnIdentifier,tColumnTitle,tMaxWidthOfColumn) into tInfo
put tInfo into cd fld 1


Please note that the column title is not the column identifier.
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am

Re: How to add data using SCTable?

Postby MichaelBluejay » Wed Jun 23, 2010 6:56 pm

Thanks! That fixed it. I also note that column identifiers are case-sensitive, unlike SuperCard variables.
MichaelBluejay
 
Posts: 28
Joined: Wed Jan 06, 2010 2:15 pm


Return to Using Externals

Who is online

Users browsing this forum: No registered users and 1 guest

cron