How to master one table field' limits

Jim Ault JimAultWins at yahoo.com
Sun Nov 26 10:58:17 CST 2006


On 11/26/06 8:42 AM, "André.Bisseret" <Andre.Bisseret at inria.fr> wrote:

> Thanks to your function, I get the comma delimited list ;
>   but only if I  <put FilledLines(fld "TheTable") into
> tFilledLines> ; Actually if I <put FilledLines(the long name of fld
> "TheTable>, this long name is put into tTable in the function instead
> of its content !
> Still a problem with "do" :-)) ?
> Well, I am keeping the short name and the function works perfectly ;
> thanks again. 

For calrity:

put FilledLines(the long name of fld "dataDisplay") into tFilledLines
--will pass the *long id* , not the contents

put FilledLines(fld (the long name of fld "dataDisplay")) into tFilledLines
--will pass the *contents* of the field

Jim Ault
Las Vegas

> 
> Le 25 nov. 06 à 12:34, Eric Chatonet a écrit :
> 
>> Bonjour André,
>> 
>> That's normal behavior since when you click in cell 3 of line 4
>> without typing anything, line 4 will contain 2 tabs :-)
>> So use a tiny function:
>> 
>> function FilledLines pFld
>>   local tTable, tList
>>   -----
>>   put pFld into tTable
>>   replace tab with empty into tTable
>>   repeat with i = 1 to the number of lines of tTable
>>   if line i of tTable <> empty then put i & comma after tList
>>   end repeat
>>   delete char -1 of tList
>>   return tList
>> end FilledLines
>> 
>> And:
>> 
>> put FilledLines(the long name of fld "TheTable") into tFilledLines
>> 
>> You'll get a comma delimited list like "1,3,8,9": the number of the
>> lines that are not empty as you wished it.
>> Note that I use the long name of fld "TheTable" as param: it's more
>> secure and allows to write directly: put pFld into tTable (without
>> using do this time ;-)
> 
> 





More information about the use-livecode mailing list