varargs best practice?

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


mark,

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
      else
        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

Cheers,

Malte



More information about the Use-livecode mailing list