View Single Post
06-19-16, 11:28 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by myrroddin View Post
Doing some random testing on libs, trying to get the major, minor to print and see the values. Boredom~

Anyway, I got nil errors for these, yet LibStub loads the lib properly if you remove the print statements:
Code:
local major = "LibUtilities-1.0"
local minor = "$Revision: 10000 $"
local lib = LibStub:NewLibrary(major, minor)
print("major: %s"):format(major)
print("minor: %s"):format(minor)
print("minor: %d"):format(tonumber(minor))
if not lib then return end
Running something like print("major: %s"):format(major) makes the ChatFrame show major: %s and throw an "attempt to index nil" error since print() doesn't return anything.





Originally Posted by Seerah View Post
Lua Code:
  1. print("your text here":format())
This causes Lua to throw a syntax error. As a quirk, the string needs to be encased in parenthesis in order to function.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)