lua-users home
lua-l archive

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


Is there any way to do assignment inside an expression? I often want
to do this in if or while blocks and whenever I try something like:

if ((a = fn()) == 2) then

or:

while (a = fn()) do

it (of course) dosn't work.. Is there some way to do assignment inside
an expression like this, and if not, why not?

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net