getting information from a table field

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
Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

getting information from a table field

Post by Glenn Boyce » Tue Aug 05, 2008 2:10 am

i have a table with 13 columns all up
each line uses a different number of columns but always sequential from LHS
Column 13 always has some information and it is stored as numbers separated by commas. by setting the delimiter to tab I can access all information except the individual items in column 13.
put item 13 of line n of fld "blends" gives me "0.925,0.921,2.02,0.98"

I have tried:

put item 2 of (item 13 of line n of fld "blends") and get ""
put word 2 of (item 13 of line n of fld "Blends") and get ""

any suggestions?

cheers

Glenn

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Tue Aug 05, 2008 5:36 am

Hi Glenn,

The first call fails because Revolution uses 'tab' as delimiter for both 'item' chunk extractions - so when it has item 13 there are no more tabs in there, hence getting item 2 of that will return empty.

The second call fails mainly because it is one giant word (no spaces) and Revolution's rules for what constitutes a word will once again mean that word 2 of that will return empty.

You'll have to extract that 'item 13 of line n' chunk into a separate variable, change the 'itemDelimiter' local property and work from there.

Code: Select all

put item 13 of line n of fld "blends" into tItem13
set the itemDelimiter to comma
put item 2 of tItem13
set the itemDelimiter to tab
Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

got it sorted - many thanks

Post by Glenn Boyce » Tue Aug 05, 2008 6:34 am

got it sorted

many thanks

Post Reply