...

From GMod Wiki

Jump to: navigation, search
DescriptionVarargs represent multiple variables.
Used onNewerShared.png
Code
function varargtest(...)
     return {...}
  end
OutputReturns all variables that have been passed to the function in a table.


DescriptionRemake of the standard math.min functions.
Used onNewerShared.png
Code
function min(...)
     local min = math.huge;
     for _,v in pairs({...}) do
          if(v < min) then
               min = v;
          end
     end
     return min;
  end
OutputReturns the lowest value of the given variables.


DescriptionTurn a table into an vararg.
Used onNewerShared.png
Code
 
  local tbl = {"a","b","c","d"};
  print(unpack(tbl));
  print(tbl);
 
OutputUnpacked table will be printed as every single value.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox