When the below script is executed, the array variable data received from the test macro function is properly stored, but when $var.size or $var.get(0) is executed, it does not work.
Since $var
works properly, I think the array object was successfully delivered through the macro function. However, I don’t know why $var.size doesn’t work.
What needs to be modified to make it work properly?
#macro (test)
#set ($variable = ["a", "b","c"])
#macro (test)
#set ($variable = ["a", "b","c"])
$variable##
#end
#macro (test2)
#set ($var = "#test()")
$var<br>
$var.size()<br>
$var.get(0)<br>
#end
#test2()
=== current result ===
[a, b, c]
$var.size()
$var.get(0)
The expected operational results are as follows.
[a, b, c]
3
a
New contributor
litestep is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.