lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: attempt to perform arithmetic on field '_income' (a table value)
From
: liam mail <liam.list@
...
>
Date
: Wed, 18 Sep 2013 13:34:48 +0100
>
So, there doesn't seem to be any issue in doing arithmetic with table fields !!
Correct there is not, although this is not what you are doing.
On 18 September 2013 13:18, Jayanth Acharya
<
jayachar88@gmail.com
>
wrote:
tax:init(12200, 12)
This is a self call which is sent three parameters not two, the first being the self instance ie a Table.
Your print statement also highlights this when you call
print(tax:getIncome(), tax:getRate())
table: 0028CA00 12200
May I suggest you look at using metatables, possibly reading 16.1 in PiL 3rd edition or 4th edition, or maybe a wiki entry[1]
[1]
http://lua-users.org/wiki/SimpleLuaClasses
Follow-Ups
:
Re: attempt to perform arithmetic on field '_income' (a table value)
,
Jayanth Acharya
References
:
attempt to perform arithmetic on field '_income' (a table value)
,
Jayanth Acharya
Prev by Date:
Re: attempt to perform arithmetic on field '_income' (a table value)
Next by Date:
Re: attempt to perform arithmetic on field '_income' (a table value)
Previous by thread:
Re: attempt to perform arithmetic on field '_income' (a table value)
Next by thread:
Re: attempt to perform arithmetic on field '_income' (a table value)
Index(es):
Date
Thread