Posted 01 May 2014 - 11:41 AM
Hi! I'm doing little spam on foum, sry for that :D/>
How can I check if variable isnt nil ?
Here is my code: http://pastebin.com/07szXe0i
I'm saying about Tank() function.
I tried if variable == nil but it doesnt work
The second problem is terminating program
When i am in tank mode ($$tank show) and i terminate program, i cant edit it. It says: edit:60: attempt to call nil
I have to reboot PC then.
EDIT: I need checking var because i saw, when tank is empty, his liquid amount is nil, so table[1].amount is nil and program crashes
How can I check if variable isnt nil ?
Here is my code: http://pastebin.com/07szXe0i
I'm saying about Tank() function.
I tried if variable == nil but it doesnt work
The second problem is terminating program
When i am in tank mode ($$tank show) and i terminate program, i cant edit it. It says: edit:60: attempt to call nil
I have to reboot PC then.
EDIT: I need checking var because i saw, when tank is empty, his liquid amount is nil, so table[1].amount is nil and program crashes
Edited on 01 May 2014 - 09:42 AM