[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: inline conditional assignment possible?
- From: Ando Sonenblick <ando@...>
- Date: Wed, 19 Nov 2003 12:39:35 -0800
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