lua-users home
lua-l archive

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


Sorry for this, I wrote the example in haste. Limit checking was erroneous, it works in the example just because the limit is 0. This is the correct way:

function LimitedAccount:withdraw(amount)
    if self:getbalance() - amount < self.limit then
...

Regards,
Hugo Etchegoyen