Lists in Transcript

Andre Garzia soapdog at mac.com
Mon May 23 17:45:06 EDT 2005


On May 23, 2005, at 6:23 PM, Dar Scott wrote:

> As you might infer from Andre's comment, you would want to avoid 
> params() in most cases.  This particular case might be the exception.
>
> Also, to build a comma'd list to be a parameter, put parentheses 
> around it.
>
> Dar

I have a silly function here that uses a paramcount() loop and put the 
param()s into a CR delim list. this function is called list(), when I 
need to pass a list to a function, I make that function work with a 
param pList that will be a cr delim chunk and call it by nesting 
functions like this example, it's a silly func, but I like it (put this 
inside a button):

on mouseUp
   demolist "Item:", list("a", "b", "c", "d", "e")
end mouseUp

function list
   local tList
   repeat with x = 1 to paramcount()
     put param(x) & cr after tList
   end repeat
   delete char -1 of tList
   return tList
end list

on demoList pPrefix, pList
   repeat with x = 1 to the number of lines in pList
     put pPrefix && line x of pList & cr after tBuffer
   end repeat
   put tBuffer
end demoList

on cheers
	andre
end cheers

>
-- 
Andre Alves Garzia ð 2004
Soap Dog Studios - BRAZIL
http://studio.soapdog.org


More information about the use-livecode mailing list