Sep 5, 2014 02:19 PM
(This post was last modified: Sep 6, 2014 03:04 PM by Remix.)
Hey everybody
i'm very bored so i tried to find something useful for LUA and i was thinking about the print and string.format function. I ever hated it to use the string.format function because i'm fking lazy.
So i had the idea to override the basic print function that you can use multiple arguments that you normaly just could use with the string.format function.
Example:
The function:
It's nothing special but it should help those people who are as lazy as i am.
Sincerely
[iRemix]
i'm very bored so i tried to find something useful for LUA and i was thinking about the print and string.format function. I ever hated it to use the string.format function because i'm fking lazy.
So i had the idea to override the basic print function that you can use multiple arguments that you normaly just could use with the string.format function.
Example:
Code
print("hello %s", "hackforums")The function:
Code
main_print = main_print or print
function print(text, ...)
if text == nil then return end
if table.getn(arg) < 1 then
return main_print(text)
end
main_print(string.format(text, unpack(arg)))
endIt's nothing special but it should help those people who are as lazy as i am.
Sincerely
[iRemix]

