@name 
@inputs 
@outputs Self NetS:string
@persist NetS:string NetA:array NetT:table Self Off Test Net
@trigger all
interval(1)
Group="Network"
gSetGroup(Group)
if(first()){timer("test",1) Net=1 Test=1}

EID=entity():id()
NetMsg="ID"
Brk="<"
NetS=gGetStr(NetMsg)
NetOff=0
if(NetOff){gDeleteStr(NetMsg)}

if(clk("test")){
    print("Net="+Net)
    NetA=NetS:explode(Brk)
    if (!entity(NetA:number(Net))){NetA:remove(Net)}
    if (Net<NetA:count()){Net++ timer("test",1)}else{Test=0}
    NetS=NetA:concat(Brk)
    gSetStr(NetMsg,NetS)
}
            
if (!Self){
    
 #NetS:replace(Brk+EID,"") print("deleting")
    NetA=NetS:explode(Brk)
    NetC=NetA:count()
    Self=NetC
    NetA:setNumber(NetC+1,EID)
    #NetT:setNumber(toString(EID),Self))
    NetS=NetA:concat(Brk)
    gSetStr(NetMsg,NetS)
    print(NetA:concat(Brk))
    print(toString(Self))
    #print(toString(NetT:number(EID)))
}

Msg=gGetStr(NetS)
timer("test",1000)
if(clk("test")){print(Msg)}
if(NetOff){gDeleteStr(NetMsg)}

