id:=Length(oper)+1;
SetLength(oper, id );
oper[Length(oper)-1].id := id-1;
oper[Length(oper)-1].group:=0;
oper[Length(oper)-1].msg:='';
I have a problem that I Don't know how to tackle in delphi.
Many programs, connected to a main program, will execute this peace of code above in order to be added as a newest operator when he connected; the problem is, when the main program verifies what is the length of the oper (array) and add one so that it can get the next free position to held a new operator, this new operator might be getting the same index(id) of another one and it would be cause a lot a problems. I'd like some suggestion of how I could solve it. I Don't know if I could explain well my problem, but I hope whom is going to help me doesn't need to strain much about I've wanted to say.
SetLength(oper, id );
oper[Length(oper)-1].id := id-1;
oper[Length(oper)-1].group:=0;
oper[Length(oper)-1].msg:='';
I have a problem that I Don't know how to tackle in delphi.
Many programs, connected to a main program, will execute this peace of code above in order to be added as a newest operator when he connected; the problem is, when the main program verifies what is the length of the oper (array) and add one so that it can get the next free position to held a new operator, this new operator might be getting the same index(id) of another one and it would be cause a lot a problems. I'd like some suggestion of how I could solve it. I Don't know if I could explain well my problem, but I hope whom is going to help me doesn't need to strain much about I've wanted to say.