Table of Content
HAL Forum
function string AddObjectToObjectList (
string Values,string NewValue)
Description:
Adds a new value to comma separated value list IF it is NOT present there yet.
Parameters:
Values The list of values that will be updated
NewValue The value that will be added to the list
external function string 60 AddObjectToObjectList(string,string);

global
procedure IVVc_PasteSalesMan(var record IVVc IVr,string oldsalesmen)
begin
  record UserVc Userr;
  string 255 tstr,salesman;
  Integer pos;

  if (HasSalesmanChanged(IVr.SalesMan,oldsalesmen)) then begin
    if (IVr.OKFlag==0) then begin
      pos = 0;
      ExtractObj(oldsalesmen,pos,salesman);
      while (nonblank(salesman)) begin
        RemoveOldUserObjects(salesman,IVr.Objects);
        ExtractObj(oldsalesmen,pos,salesman);
      end;
    end;
    IVr.SalesGroup = "";    

    pos = 0;
    ExtractObj(IVr.SalesMan,pos,salesman);
    while (nonblank(salesman)) begin
      Userr.Code = salesman;
      if (ReadFirstMain(Userr,1,true)) then begin
        IVr.SalesGroup = AddObjectToObjectList(IVr.SalesGroup,Userr.SalesGroup);                
        if (IVr.OKFlag==0) then begin
          IVr.Objects = AddObjectToObjectList(IVr.Objects,Userr.PersObjx);        
        end;
      end;
      ExtractObj(IVr.SalesMan,pos,salesman);
    end;
  end;
  return;
end;

Related topics:
««