Oct 31, 2014; 17:23
Jolle Carlestam
How keep an integer value a reference when manipulated?
This works:
define mytest(
inputvalue
) => {
#inputvalue -> append('1')
return #inputvalue
}
local(myvalue = '1')
mytest(#myvalue)
'<br />'
mytest(#myvalue)
'<br />'
mytest(#myvalue)
-> 11
111
1111
But this doesn=92t:
define mytest(
inputvalue
) => {
#inputvalue++
return #inputvalue
}
local(myvalue = 1)
mytest(#myvalue)
'<br />'
mytest(#myvalue)
'<br />'
mytest(#myvalue)
-> 2
2
2
It seems as if #something++ internally is treated as #something = #something + 1 and thus breaking the reference.
Same problem using #something += 1
How can I change the content of an integer without breaking the reference?
HDB
Jolle
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Oct 31, 2014; 18:23
Brad Lindsay
Re: How keep an integer value a reference when manipulated?