Posted: Mon Jul 23, 2018 4:55 am Post subject: how to read value from editbox and perform arithmetic on it.
Hi there!
am getting an error in my code and due to lack of coding skills I can't fix it myself and am here asking for help if someone can.
I have two memory addresses, two Edit Boxes and Two Buttons in my trainer. What I want to do is :
1. when a user enter some digits in first edit box then I read its value, add "0.1" in it and then apply the value to the memory address/
2. when he enter digits in second Edit box then I read its value and add "0.2" in it then apply it to memory address.
I tried to do so but failed, here it is,
1 :-
local readN = getProperty(CEEdit1_UDF1, "TEXT")
local newN = readN + 0.1
wirteFloat(0086FFE2"", newN)
and
2 :-
local readM = getProperty(CEEdit2_UDF1, "TEXT")
local newM = readM + 0.2
wirteFloat("00FFAD00", newM)
the error im getting in this is that I am trying to perform arithmetic operation on a NIl, IDK whtas this but maybe because am trying to add a numerci value in string(what the code recognize it as lol).
Any help will be appreciated. If you guys want more explanation about the problem, feel free to ask.
the error im getting in this is that I am trying to perform arithmetic operation on a NIl,
How a 'TEXT' can be subtract with a number ?.
As TheyCallMeTim13 code above, you see a command 'tonumber'.
This convert 'number as text' to 'number' which able to perform an arithmetic operation. _________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum