lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi gang,

I'm trying to assign a varible in an if statement and have its resulting value be evaluated for the if. For example:

Normal way:

s = project:FindSprite("Title")
if s ~= nil then
print("we have a title")
end

New desired way:

if (s = project:FindSprite("Title")) ~= nil then
print("we have a title")
end

But lua always complains and I've tried all sorts of syntactical variations. Is what I'm trying to do possible?

thx,
ando