Page 1 of 1

Issue with variables

Posted: Thu May 14, 2015 12:23 am
by EtienneO
How do I get this to return;
Hello
World

instead of;
1
2

:global Test1 Hello
:global Test2 World

:for n from 1 to 2 do={
:put "$Test$n"
}

Re: Issue with variables

Posted: Thu May 14, 2015 1:40 am
by BartoszP
{
:global Test1 "Hello"
:global Test2 "World"
:global EvalTestn "";
:global EvalRes ""

 :for n from=1 to=2 do={
  :set EvalTestn [:parse ":global Test$n; :global EvalRes; :set EvalRes \$Test$n"]
  $EvalTestn
  :put ($EvalRes)
 }
}

Re: Issue with variables

Posted: Thu May 14, 2015 3:43 am
by EtienneO
Thanks, that works, now I just have to figure out why :-) (It works)