help with loop script and global

Hello ,
I want to be able to get the name of the interface according to the number of it
so if I have 3 ppp-client I will save 3 global ppp (the max ppp-client I could have is 4)
this is what I did:

:global NumOfPpp [/interface ppp-client print count-only where allow!=mschap1]; ##get total of ppp
:set NumOfPpp [:tonum $NumOfPpp];## save it as number

:global ppp1;
:global ppp2;
:global ppp3;
:global ppp4;
:global c 0;
foreach i in=[/interface ppp-client find where allow!=mschap1] do={:set "ppp$NumOfPpp" [/interface ppp-client get $i name]}

###I have also try this commands###
foreach i in=[/interface ppp-client find where allow!=mschap1] do={:set "ppp.$NumOfPpp" [/interface ppp-client get $i name]}

while ($c<$NumOfPpp) do={:set "ppp$c" [/interface ppp-client get number=$c name]; :set c ($c+1)}
while ($c<$NumOfPpp) do={:set "ppp.$c" [/interface ppp-client get number=$c name]; :set c ($c+1)}

but the value stay empty
what am I doing wrong?

Thanks ,