HungerJohnson

Untitled

Oct 24th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. function s_anyVariable(data, lastType, isNumeric, isKey, isLast, nice, indent)
  2.  
  3.     --  Basically, if the type changes.
  4.     if lastType ~= type(data) then
  5.         --  Remember the new type. Caching the type is useless.
  6.         lastType = type(data)
  7.        
  8.         if (!_serialize[lastType]) then
  9.             ErrorNoHalt("vON: Unknown type "..lastType.."!");
  10.         end;
  11.  
  12.         --  Return the serialized data and the (new) last type.
  13.         --  The second argument, which is true now, means that the data type was just changed.
  14.         return _serialize[lastType](data, true, isNumeric, isKey, isLast, nice, indent), lastType
  15.     end
  16.  
  17.     --  Otherwise, simply serialize the data.
  18.     return _serialize[lastType](data, false, isNumeric, isKey, isLast, nice, indent), lastType
  19. end
Advertisement
Add Comment
Please, Sign In to add comment