onedreamcloser
ISP
hello All,
please find below a snippet of code that passes an array, manipulates the array, but i cannot return the new version of array.
here is the snippet :
And the output of the code is :
Could you please help show me how the "MULTICAST" variable can be assigned to "multicast" ?
please find below a snippet of code that passes an array, manipulates the array, but i cannot return the new version of array.
here is the snippet :
Code:
proc get_mroute_active { &multicast } {
upvar ${&multicast} MULTICAST ;
set group -1 ;
set src -1 ;
set mcast_group_source_id -1 ;
set MULTICAST($mcast_group_source_id,id) $mcast_group_source_id ;
set MULTICAST($mcast_group_source_id,mcast_group) $group ;
set MULTICAST($mcast_group_source_id,mcast_source) $src ;
puts [array size MULTICAST] ;
parray MULTICAST ;
}
array set multicast { } ;
get_mroute_active [array get multicast] ;
puts [array size multicast] ;
parray multicast ;
And the output of the code is :
Code:
3
MULTICAST(-1,id) = -1
MULTICAST(-1,mcast_group) = -1
MULTICAST(-1,mcast_source) = -1
0
Could you please help show me how the "MULTICAST" variable can be assigned to "multicast" ?