Anyway to make Function calculations already when formed?
Posted: Sun Mar 22, 2020 9:17 pm
Dont know what word to use, but what I want to do on fly is to make functions calculations done already when formed
I have this situation where I am trying to put to "OnMouseOver = Function() stuff EndFunction"
where I want part of that "stuff" to be decided at that point already. Let me give you an example:
What I want to make here is to make 5 buttons, and when mouseover happens, I want it to happen so that on first button result = 2, second button result = 3 etc.
however, in practice what happens in here is that each button gives same result, since result depends upon what the result of "n" happens to be at that time in program.
Is there a way to do this is such way that the result would be made already at this point to become n+1, instead of it being calculated at point when mouseover happens?
I have this situation where I am trying to put to "OnMouseOver = Function() stuff EndFunction"
where I want part of that "stuff" to be decided at that point already. Let me give you an example:
Code: Select all
for n = 1 to 5
...
MakeButton... OnMouseOver = Function()
result = n+1
endfunction)however, in practice what happens in here is that each button gives same result, since result depends upon what the result of "n" happens to be at that time in program.
Is there a way to do this is such way that the result would be made already at this point to become n+1, instead of it being calculated at point when mouseover happens?