Inserting data into tables

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Inserting data into tables

Post by Andycal » Thu Nov 08, 2007 5:12 pm

Initially posted this in the Media forum, oops!

I'm trying to put data into a table field, without binding it to a database. It looks easy enough and I came up with the following:

on mouseup
put "A Smith&tab0121 345654&tab08/11/2007 09:41" into field tblCalls
end mouseup

The idea being that this would spread the data across the cells. However, even if I just try to put something simple in there, it just doesn't accept it, I get an error "No such object"

Any ideas? There appears to be no documentation about tables.

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Nov 08, 2007 6:50 pm

Hi Andy,

you need more quotes and "&"s! :-)

...
put "A Smith" & tab & "0121 345654" & tab & "08/11/2007 09:41" into field tblCalls
...

This presumes that tblCalls is a variable that hold the actual name of the field!
If that is the name of the field then you need to put quotes here, too!

...
put "A Smith" & tab & "0121 345654" & tab & "08/11/2007 09:41" into field "tblCalls"
...

TAB is NOT part of the string that you are composing to put into the field "en bloc" afterwards.

You can also specify the line you want to put this string into, just in case there is already data in the field. The command above will always replace the complete content of the field!

...
put "A Smith" & tab & "0121 345654" & tab & "08/11/2007 09:41" into line 3 of field "tblCalls!
...

Hope that helps.


Best

Klaus

Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Post by Andycal » Thu Nov 08, 2007 8:29 pm

Ahhhh.. Gotcha! Cheers Klaus!

Post Reply