varargs best practice?

Malte Brill revolution at
Tue Dec 7 03:24:49 EST 2010


Is this any help?

function doCommand
local tValue,tParam,tVerb
 repeat with i=1 to paramcount()
  if i<paramcount() then
        put param(i)&"," after tValue
        put param(i) after tValue
      end if
    end repeat
-- now you have all args in one string, seperated by commas. First one is tVerb
    put item 1 of tValue into tVerb
-- do something with the remainder
   repeat with i=2 to the number of items of tValue
     put item i of tValue into tParam[i]
   end repeat
end doCommand



More information about the Use-livecode mailing list